From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: David Kastrup Newsgroups: gmane.lisp.guile.user Subject: Re: Lilypond speed (was Re: How to make GNU Guile more successful) Date: Thu, 09 Mar 2017 00:50:58 +0100 Organization: Organization?!? Message-ID: <87k27z49b1.fsf@fencepost.gnu.org> References: <2e4e293e-618e-809a-2eff-31576319ea61@gmx.de> <874lzod28a.fsf@web.de> <6deb1610-e31b-b5c2-e9c9-95a2289af216@gmx.de> <87mvdfs6mh.fsf@web.de> <871sued8h7.fsf@fencepost.gnu.org> <87tw78sj34.fsf@web.de> <87h9369lz8.fsf_-_@pobox.com> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1489017107 4749 195.159.176.226 (8 Mar 2017 23:51:47 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Wed, 8 Mar 2017 23:51:47 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.50 (gnu/linux) To: guile-user@gnu.org Original-X-From: guile-user-bounces+guile-user=m.gmane.org@gnu.org Thu Mar 09 00:51:42 2017 Return-path: Envelope-to: guile-user@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cllMs-0000dJ-6Q for guile-user@m.gmane.org; Thu, 09 Mar 2017 00:51:42 +0100 Original-Received: from localhost ([::1]:59187 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cllMy-0004M1-6D for guile-user@m.gmane.org; Wed, 08 Mar 2017 18:51:48 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:34124) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cllMQ-0004KB-Kf for guile-user@gnu.org; Wed, 08 Mar 2017 18:51:16 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cllMM-0007vJ-1P for guile-user@gnu.org; Wed, 08 Mar 2017 18:51:14 -0500 Original-Received: from [195.159.176.226] (port=52622 helo=blaine.gmane.org) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1cllML-0007ue-Po for guile-user@gnu.org; Wed, 08 Mar 2017 18:51:09 -0500 Original-Received: from list by blaine.gmane.org with local (Exim 4.84_2) (envelope-from ) id 1cllMB-00051e-TB for guile-user@gnu.org; Thu, 09 Mar 2017 00:50:59 +0100 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 102 Original-X-Complaints-To: usenet@blaine.gmane.org X-Face: 2FEFf>]>q>2iw=B6, xrUubRI>pR&Ml9=ao@P@i)L:\urd*t9M~y1^:+Y]'C0~{mAl`oQuAl \!3KEIp?*w`|bL5qr,H)LFO6Q=qx~iH4DN; i"; /yuIsqbLLCh/!U#X[S~(5eZ41to5f%E@'ELIi$t^ Vc\LWP@J5p^rst0+('>Er0=^1{]M9!p?&:\z]|;&=NP3AhB!B_bi^]Pfkw Cancel-Lock: sha1:ZOloDsFfl0E5bR6q1z+5028w0Xw= X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 195.159.176.226 X-BeenThere: guile-user@gnu.org X-Mailman-Version: 2.1.21 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.org@gnu.org Original-Sender: "guile-user" Xref: news.gmane.org gmane.lisp.guile.user:13451 Archived-At: Thomas Morley writes: > So guile 2.1.7 is indeed faster than 2.0.14 with this test-file, otoh > I've redone testings with the other file and can confirm 2.1.7 being > slower there. > Currently I've no clue why. Lot's of output? The output files are generated in lily/paper-outputter.cc with SCM Paper_outputter::dump_string (SCM scm) { return scm_display (scm, file ()); } SCM Paper_outputter::scheme_to_string (SCM scm) { return scm_eval (scm, output_module_); } SCM Paper_outputter::module () const { return output_module_; } SCM Paper_outputter::output_scheme (SCM scm) { SCM str = scheme_to_string (scm); if (scm_is_string (str)) dump_string (str); return str; } SCM paper_outputter_dump (void *po, SCM x) { Paper_outputter *me = (Paper_outputter *) po; return me->output_scheme (x); } void Paper_outputter::output_stencil (Stencil stil) { interpret_stencil_expression (stil.expr (), paper_outputter_dump, (void *) this, Offset (0, 0)); } So every output item is generated by running a humongous expression through scm_eval and then calling scm_display on the expression (when it turns out it is a string). For PDF output, those strings are generated in the PostScript backend in scm/output-ps.scm, typically with stuff like: (define (char font i) (ly:format "~a (\\~a) show" (ps-font-command font) (ly:inexact->string i 8))) (define (circle radius thick fill) (ly:format "~a ~4f ~4f draw_circle" (if fill "true" "false") radius thick)) with ly:format defined in C and consequently ping-ponging strings through the SCM API (using scm_to_locale_stringbuf and scm_take_locale_stringn). So the basic question is whether the output generation phase (after all typesetting and page breaking has finished) is significantly involved in the total slowdown or not. > Btw, I've improved my local setup to be able to test lilypond more > quickly with different guile versions. Though I wasn't able to compile > 1.8.8, neither from the repository nor from the tarball downloaded > from > https://www.gnu.org/software/guile/download/ > Due to: > async.c: In function 'scm_i_queue_async_cell': > async.c:243:14: error: variable 'count' set but not used > [-Werror=unused-but-set-variable] > size_t count; > ^ > > Am I missing something? Remove compilation option -Wall here? > I'm aware noone is interested in developing 1.8.8 further, There was just a question on the developer list (I think) how to best maintain a fork of 1.8. -- David Kastrup