[plt-scheme] help on how to write a frequency-counting function in a more functional way

From: Doug Orleans (dougorleans at gmail.com)
Date: Tue Apr 28 23:02:37 EDT 2009

On Sun, Apr 19, 2009 at 11:56 AM, Matthew Flatt <mflatt at cs.utah.edu> wrote:
> The performance is close to the binary-tree performance, probably
> because that's how functional hash tables are implemented internally
> (but as red-black trees, so they're always balanced).

I had been naively assuming that immutable hash tables were as
efficient as mutable ones.  It would be good to say more about their
relative performance in the reference manual than just "immutable
tables support constant-time functional update."

I had also been assuming that immutable structures were better than
mutable ones because of garbage collector write-barrier issues.   Are
there situations where immutable hash tables are more efficient in
practice than mutable ones due to this effect, even if they are
algorithmically less efficient?

--dougorleans at gmail.com


Posted on the users mailing list.