chicken-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: New egg: CHICKEN Transducers


From: Chris Brannon
Subject: Re: New egg: CHICKEN Transducers
Date: Thu, 05 Jan 2023 03:22:28 -0800
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux)

Jeremy Steward <jeremy@thatgeoguy.ca> writes:

> And I've written a short blog post outlining some of my frustrations
> that led me to writing this egg:
>
> <https://www.thatgeoguy.ca/blog/2023/01/04/reflections-on-transducers/>

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

[Prev in Thread] Current Thread [Next in Thread]