From: spacecadet <spacecadet@purge.sh>
To: 72688@debbugs.gnu.org
Subject: bug#72688: big lets are deathly slow
Date: Sat, 17 Aug 2024 20:47:03 +0000 [thread overview]
Message-ID: <d5c17b39-e63f-acdf-bfb7-875e1e416ab2@purge.sh> (raw)
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
reply other threads:[~2024-08-17 20:47 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/guile/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=d5c17b39-e63f-acdf-bfb7-875e1e416ab2@purge.sh \
--to=spacecadet@purge.sh \
--cc=72688@debbugs.gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).