unofficial mirror of guile-devel@gnu.org 
 help / color / mirror / Atom feed
* Guile optimizations slowing down the program?
@ 2022-03-08 23:31 Jean Abou Samra
  2022-03-09  7:28 ` Maxime Devos
  0 siblings, 1 reply; 5+ messages in thread
From: Jean Abou Samra @ 2022-03-08 23:31 UTC (permalink / raw)
  To: guile-user, guile-devel

Hi,

LilyPond has a fairly sized body of Scheme code. With Guile 2,
the byte-compilation with default settings takes 1 minute, and
1min30 with Guile 3, so I've been experimenting with reducing
optimizations to make it faster for development cycles. I've found
that disabling optimizations reduces the byte-compilation time to
20s in Guile 2, and just 4s in Guile 3 (thanks to the baseline
compiler). Naturally, I've tried to see how much that slowed down
the resulting version of LilyPond. To my surprise, it looks like
these unoptimized versions are actually faster. In Guile 2, I'm
not sure if the difference is significant, but it definitely looks
so in Guile 3. This is one benchmark, comparing optimization level
0 against level 2 (the latter is the default):

                   Baseline   New executable    Delta
_________________________________________________________________________________________
│ Min            │ 4.060    │ 4.020          │ 
-0.99%                                     │
│ Mean           │ 4.138    │ 4.096          │ 
-1.03%                                     │
│                │          │                │ (difference is -2.86 
times standard error) │
│ Standard error │ 0.014    │ 0.015 
│                                            │
└────────────────┴──────────┴────────────────┴────────────────────────────────────────────┘


Here's a different benchmark (on a much larger LilyPond file):

                   Baseline   New executable    Delta
___________________________________________________________________________________________
│ Min            │ 35.380   │ 34.600         │ 
-2.20%                                     │
│ Mean           │ 36.065   │ 34.913         │ 
-3.20%                                     │
│                │          │                │ (difference is -9.10 
times standard error) │
│ Standard error │ 0.173    │ 0.080 
│                                            │
└────────────────┴──────────┴────────────────┴────────────────────────────────────────────┘



Same benchmarks, with optimization level 1:

                    Baseline   New executable   Delta
___________________________________________________________________________________________
│ Min            │ 4.040    │ 4.040          │ 
0.00%                                      │
│ Mean           │ 4.256    │ 4.244          │ 
-0.28%                                     │
│                │          │                │ (difference is -0.57 
times standard error) │
│ Standard error │ 0.022    │ 0.020 
│                                            │
└─────────────────────────────────────────────────────────────────────────────────────────|

                   Baseline    New executable   Delta

___________________________________________________________________________________________
│ Min            │ 35.500   │ 34.450         │ 
-2.96%                                     │
│ Mean           │ 36.069   │ 35.081         │ 
-2.74%                                     │
│                │          │                │ (difference is -6.27 
times standard error) │
│ Standard error │ 0.117    │ 0.198 
│                                            │
└────────────────┴──────────┴────────────────┴────────────────────────────────────────────┘


In summary, the less Guile optimizes, the faster LilyPond runs. Is that
something expected?

Best,
Jean




^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2022-03-09 10:25 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-03-08 23:31 Guile optimizations slowing down the program? Jean Abou Samra
2022-03-09  7:28 ` Maxime Devos
2022-03-09  7:53   ` Dr. Arne Babenhauserheide
2022-03-09 10:01     ` Jean Abou Samra
2022-03-09 10:25       ` Dr. Arne Babenhauserheide

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).