Jeremy Steward <> writes:

> And I've written a short blog post outlining some of my frustrations
> that led me to writing this egg:
> <>

That was a fantastic post.  I'm still digesting it.  How about SRFI 42?
Here's your example from the transducer benchmark, written with SRFI 42:

(import srfi-42)
(time (fold-ec 0 (:range x 100000000) (if (odd? x)) (* x 3) +))

And here is a comparison of performance characteristics:

Script started on 2023-01-05 03:14:57-08:00 [TERM="screen.linux" 
TTY="/dev/pts/4" COLUMNS="80" LINES="30"]
$ ./transducer-bench
12.278s CPU time, 0.002s GC time (major), 1/108400 GCs (major/minor), maximum 
live heap: 879.61 KiB
$ ./srfi-42-bench
3.5s CPU time, 0/70231 GCs (major/minor), maximum live heap: 478.02 KiB
$ exit

Script done on 2023-01-05 03:15:28-08:00 [COMMAND_EXIT_CODE="0"]

-- Chris

Reply via email to