From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Andy Wingo Newsgroups: gmane.lisp.guile.bugs Subject: Re: Serious performance issues with 1.9.0 Date: Sun, 26 Jul 2009 14:01:14 +0200 Message-ID: References: <200907151107.54800.martin@gkc.org.uk> <200907161116.21975.martin@gkc.org.uk> <87d47z5oh4.fsf@gnu.org> <200907171827.00486.martin@gkc.org.uk> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1248612326 27981 80.91.229.12 (26 Jul 2009 12:45:26 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 26 Jul 2009 12:45:26 +0000 (UTC) Cc: bug-guile@gnu.org, Ludovic =?utf-8?Q?Court=C3=A8s?= , Neil, Jerram To: Martin Ward Original-X-From: bug-guile-bounces+guile-bugs=m.gmane.org@gnu.org Sun Jul 26 14:45:18 2009 Return-path: Envelope-to: guile-bugs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1MV36L-0000PM-Kb for guile-bugs@m.gmane.org; Sun, 26 Jul 2009 14:45:17 +0200 Original-Received: from localhost ([127.0.0.1]:55187 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MV36L-0000G9-5G for guile-bugs@m.gmane.org; Sun, 26 Jul 2009 08:45:17 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MV36F-0000El-Jl for bug-guile@gnu.org; Sun, 26 Jul 2009 08:45:11 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MV36A-0000EU-Hm for bug-guile@gnu.org; Sun, 26 Jul 2009 08:45:11 -0400 Original-Received: from [199.232.76.173] (port=59578 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MV36A-0000EQ-C5 for bug-guile@gnu.org; Sun, 26 Jul 2009 08:45:06 -0400 Original-Received: from a-sasl-quonix.sasl.smtp.pobox.com ([208.72.237.25]:55804 helo=sasl.smtp.pobox.com) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MV364-0004ol-U0; Sun, 26 Jul 2009 08:45:01 -0400 Original-Received: from localhost.localdomain (unknown [127.0.0.1]) by a-sasl-quonix.sasl.smtp.pobox.com (Postfix) with ESMTP id 5EEFA147E0; Sun, 26 Jul 2009 08:45:00 -0400 (EDT) Original-Received: from unquote (unknown [81.38.186.175]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by a-sasl-quonix.sasl.smtp.pobox.com (Postfix) with ESMTPSA id 33BAE147DF; Sun, 26 Jul 2009 08:44:55 -0400 (EDT) In-Reply-To: <200907171827.00486.martin@gkc.org.uk> (Martin Ward's message of "Fri, 17 Jul 2009 18:27:00 +0100") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.92 (gnu/linux) X-Pobox-Relay-ID: 21C3FC00-79E2-11DE-B48D-F699A5B33865-02397024!a-sasl-quonix.pobox.com X-detected-operating-system: by monty-python.gnu.org: Solaris 10 (beta) X-BeenThere: bug-guile@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Bug reports for GUILE, GNU's Ubiquitous Extension Language" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: bug-guile-bounces+guile-bugs=m.gmane.org@gnu.org Errors-To: bug-guile-bounces+guile-bugs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.lisp.guile.bugs:4282 Archived-At: Hi Martin, On Fri 17 Jul 2009 19:27, Martin Ward writes: > Now here's something totally wierd with Guile 1.8.7: > > echo '(load "ALL.scm")(load "prog_to_spec_TEST.scx")(exit)' | /usr/bin/time > guile > > takes 139 seconds CPU time. > > /usr/bin/time guile -l ALL.scm -s prog_to_spec_TEST.scx > > takes only 56 seconds CPU time. > > You read that right: if I pass the files on the command line > it takes less than half the time to process, compared to typing "load" > commands at the prompt, or sending them to standard input. > > The same thing happens with Guile 1.9.1: > > Echo load commands to stdin: 301 seconds CPU time > Pass the files on the command line: 150 seconds CPU time. And pulling up some other numbers you mentioned in another mail: > Testing prog_to_spec_TEST.scx: > > Guile 1.9.1: 260.9 secs > Guile 1.8.7: 135.9 secs > Gambit v4.4.4: 88.3 secs > SCM version 5e5: 29.4 secs > Hobbit compiled: 1.3 secs The difference between the two Guile times in both cases is the lengthier runs use the debugging evaluator, which gives you nice backtraces among other things. Guile 1.9.1 is slower than 1.8.7 because the interpreter receives more "primitive" code -- many of the speed special-cases don't have a chance to work in 1.9.1. However the good news, or perhaps just "better" news, is that Guile from git can compile your code now. Compiling ALL.scm takes a good long time -- it could be 3 minutes or so, I didn't measure -- but once it's compiled it loads instantly, and you don't have to compile it again unless ALL.scm changes. (As Ludovic mentioned, in the future we should support autocompilation for files passed on the command line.) Compiling prog_to_spec_TEST takes just a couple of seconds. Running that, I got: scheme@(guile-user)> (use-modules (system base compile)) scheme@(guile-user)> (compile-file "/tmp/ALL.scm") $1 = "/home/wingo/.cache/guile/ccache/1.9/tmp/ALL.scm.go" scheme@(guile-user)> (load-compiled $1) scheme@(guile-user)> (compile-file "/tmp/prog_to_spec_TEST.scx") $2 = "/home/wingo/.cache/guile/ccache/1.9/tmp/prog_to_spec_TEST.scx.go" scheme@(guile-user)> ,t (load-compiled $2) 1st test of `Prog_To_Spec' was OK. 2nd test of `Prog_To_Spec' was OK. 3rd test of `Prog_To_Spec' was OK. 4th test of `Prog_To_Spec' was OK. 5th test of `Prog_To_Spec' was OK. 6th test of `Prog_To_Spec' was OK. 7th test of `Prog_To_Spec' was OK. 8th test of `Prog_To_Spec' was OK. 9th test of `Prog_To_Spec' was OK. 10th test of `Prog_To_Spec' was OK. 11th test of `Prog_To_Spec' was OK. 12th test of `Prog_To_Spec' was OK. 13th test of `Prog_To_Spec' was OK. #t clock utime stime cutime cstime gctime 30.09 29.64 0.09 0.00 0.00 0.24 So, 30 seconds. Note that that's with full debugging information -- which takes up a fair amount of the 4.5 MB compiled version of ALL.scm. Also, it's with the debugging version of the VM, which performs many safety checks. I suspect we could get it faster with the VM, but big further improvements should involve native code compilation, I think, and will take some time. Thanks for the bug report, it found some interesting issues. Andy -- http://wingolog.org/