From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Israelsson Tampe Newsgroups: gmane.lisp.guile.user,gmane.lisp.guile.devel Subject: Re: Python-on-guile Date: Sun, 25 Apr 2021 12:21:41 +0200 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="21020"; mail-complaints-to="usenet@ciao.gmane.io" Cc: guile-user , guile-devel To: Mikael Djurfeldt Original-X-From: guile-user-bounces+guile-user=m.gmane-mx.org@gnu.org Sun Apr 25 12:22:20 2021 Return-path: Envelope-to: guile-user@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1labu7-0005M9-HM for guile-user@m.gmane-mx.org; Sun, 25 Apr 2021 12:22:19 +0200 Original-Received: from localhost ([::1]:53334 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1labu6-0006wV-KW for guile-user@m.gmane-mx.org; Sun, 25 Apr 2021 06:22:18 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:51670) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1labtk-0006wD-13; Sun, 25 Apr 2021 06:21:56 -0400 Original-Received: from mail-pj1-x1035.google.com ([2607:f8b0:4864:20::1035]:37756) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1labti-0001e6-6J; Sun, 25 Apr 2021 06:21:55 -0400 Original-Received: by mail-pj1-x1035.google.com with SMTP id e8-20020a17090a7288b029014e51f5a6baso3522109pjg.2; Sun, 25 Apr 2021 03:21:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=DEMxwtwyuwDmBIVrRPG3xD1hvb/rKMnNCXfff/ai8Lc=; b=jN5iS5lurHvRWcubnRRwSRDOU7n451Nn+WdJX+tjxbKgqxuIqpsKSV3DbDaJAvTAYB AXjSGhFntuXWjC0JAfRkKHo3BQFjH+P0HEV8WaKd0JnwfsbkbmRidXGCVkWkhS4KY02j WeArMDhdldth+3HDYtv8IZYo642j8E8+88MSKXU+tIqwx7951BlOFGXBOrroIG51oXdZ /3PCJ+fBEGDQ+8INoTNk7ksG0xpgjL50++NEQhmXR0dTdu+nY9Y60ESdfBjrkisKUjcD E5oI1bp2FiHkX9Mnk5VgNgDQ3mrDF/QgsVfO1RIdC6bHnZ2+PhMt3RNBXMpI9aq67VsQ I2vQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=DEMxwtwyuwDmBIVrRPG3xD1hvb/rKMnNCXfff/ai8Lc=; b=a0Kq2H9/A2E3+JT4wR0L63wr2pgy5ZS6Voc+UUwBABoZY+RtBFavbG47armsQ5svSw A9UWwTSXyhWyWOALKrn7YKbwzoudAXKj3GVjwmOYpjeWmWjlI2MzZ0h2vdziJLO+PcMU l+DzMMEzQRR3RnRCzuouWDbDjf2wcqwhfy16r1/Ky26toJp/4bnXuGn29G7Kd1vn5w5d LY7d0xGt2f62uZTbfBjktFVh/MWM6lY3kZXQoTiFZhYHLQQzlS4c0kEGjHf4OjGUxyHl CJNMAagJL0RP+sA2W6VO5yOior0GdsVsts/u5BqOsaYc0f8nKnkBMH6mgppuK76P8KyX RvmQ== X-Gm-Message-State: AOAM533OrlPHR5M0USWaJthInEY4zdxd03gvAyJ34TE4lzodoZ67sqbx opPtqsN669DkSFjqN6sHw8jYA9ZnGE3m5t/lnGQ= X-Google-Smtp-Source: ABdhPJwGkkvUhII7bbH2ZZbVpIu+WmZetzbcb9XVVPxNkqLjXQlHJQDvo30cuHGTzB2vn2X4p21+iYjCw5rkYyLnM1A= X-Received: by 2002:a17:90a:2e03:: with SMTP id q3mr10843514pjd.206.1619346112438; Sun, 25 Apr 2021 03:21:52 -0700 (PDT) In-Reply-To: Received-SPF: pass client-ip=2607:f8b0:4864:20::1035; envelope-from=stefan.itampe@gmail.com; helo=mail-pj1-x1035.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Content-Filtered-By: Mailman/MimeDel 2.1.23 X-BeenThere: guile-user@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: General Guile related discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guile-user-bounces+guile-user=m.gmane-mx.org@gnu.org Original-Sender: "guile-user" Xref: news.gmane.io gmane.lisp.guile.user:17452 gmane.lisp.guile.devel:20752 Archived-At: It is not the break let/ex that slows it down. But for wha it's worth we do not do a let/ec if no break is used. Now. On Sun, 25 Apr 2021, 10:20 Mikael Djurfeldt wrote: > Nice! > > I guess it would be nice if "continue" *could* be compiled efficiently. > And, as you indicate, perhaps that would amount to efficiently compiling > let/ec. > > Best regards, > Mikael > > On Sat, Apr 24, 2021 at 5:19 PM Stefan Israelsson Tampe < > stefan.itampe@gmail.com> wrote: > >> Guile is 3x faster then fastest python-on-guile which is 2x faster then >> python3 Cpython >> >> attached is a guile corresponding program. >> >> On Sat, Apr 24, 2021 at 4:41 PM Stefan Israelsson Tampe < >> stefan.itampe@gmail.com> wrote: >> >>> To note is that 'continue' is killing performance for python-on-guile >>> programs, so by changing the >>> code to not use continue lead to python-on-guile running twice the speed >>> of python3. The reason is that >>> the while loop is used as >>> (while (...) >>> (let/ec continue >>> ...)) >>> >>> And the let/ec is probably not optimally compiled. Python-on-guile will >>> check the loop for continue usage and if not then it will skip the let/ec. >>> >>> I attached the code not using continue >>> >>> On Sat, Apr 24, 2021 at 2:59 PM Stefan Israelsson Tampe < >>> stefan.itampe@gmail.com> wrote: >>> >>>> Actually changing in (language python compile), >>>> >>>> (define (letec f) >>>> (let/ec x (f x)))) >>>> >>>> To >>>> >>>> (define-syntax-rule (letec f) >>>> (let/ec x (f x)))) >>>> >>>> Actually lead to similar speeds as python3. >>>> >>>> >>>> >>>> On Sat, Apr 24, 2021 at 1:26 PM Stefan Israelsson Tampe < >>>> stefan.itampe@gmail.com> wrote: >>>> >>>>> Pro tip, when running this on guile the scheme code that it compilse >>>>> to is located in log.txt. >>>>> If you ,opt the resulting code in a guile session you might be able to >>>>> pinpoint issues that >>>>> delays the code execution. >>>>> >>>>> On Sat, Apr 24, 2021 at 12:04 PM Mikael Djurfeldt < >>>>> mikael@djurfeldt.com> wrote: >>>>> >>>>>> (I should perhaps add that my script doesn't benchmark the object >>>>>> system but rather loops, conditionals and integer arithmetic.) >>>>>> >>>>>> Den fre 23 apr. 2021 17:00Mikael Djurfeldt >>>>>> skrev: >>>>>> >>>>>>> Hi, >>>>>>> >>>>>>> Yesterday, Andy committed new code to the compiler, some of which >>>>>>> concerned skipping some arity checking. >>>>>>> >>>>>>> Also, Stefan meanwhile committed something called "reworked object >>>>>>> system" to his python-on-guile. >>>>>>> >>>>>>> Sorry for coming with unspecific information (don't have time to >>>>>>> track down the details) but I noticed that my benchmark script written in >>>>>>> Python, and which computes the 20:th Ramanujan number, now runs 60% faster >>>>>>> than before these changes. >>>>>>> >>>>>>> This means that python-on-guile running on guile3 master executes >>>>>>> python code only 2.6 times slower than the CPython python3 interpreter >>>>>>> itself. :-) >>>>>>> >>>>>>> Have a nice weekend all, >>>>>>> Mikael >>>>>>> >>>>>>>