unofficial mirror of bug-guile@gnu.org 
 help / color / mirror / Atom feed
* bug#72688: big lets are deathly slow
@ 2024-08-17 20:47 spacecadet
  0 siblings, 0 replies; only message in thread
From: spacecadet @ 2024-08-17 20:47 UTC (permalink / raw)
  To: 72688

performance of let seems to be about O(n^2) for n bindings

bash script to reproduce


range="$1"
time guile --no-auto-compile <( printf "(let ("; for i in $(seq 0 $range); do printf "(foo%s 'bar)" $i; done; printf ") '())" )


$ ./let.sh 10000

real    0m1.059s
user    0m1.306s
sys     0m0.064s

$ ./let.sh 20000

real    0m3.901s
user    0m4.197s
sys     0m0.078s

$ ./let.sh 40000

real    0m14.955s
user    0m15.707s
sys     0m0.188s

$ ./let.sh 80000
./let.sh: line 2:  6182 Segmentation fault      guile --no-auto-compile <( printf '(let ('; for i in $(seq 0 $range); do printf '(foo%s '"'"'bar)' $i; done; printf ") '())" )

real    0m58.146s
user    0m59.156s
sys     0m0.326s





^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2024-08-17 20:47 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-08-17 20:47 bug#72688: big lets are deathly slow spacecadet

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).