[racket] Extremely slow reading a hash

From: Robby Findler (robby at eecs.northwestern.edu)
Date: Tue Mar 8 23:18:01 EST 2011

I don't know if this has been fixed or not, but it is not difficult to
try a more recent version. You can build it in your own home directory
pretty easily once you get the basic source development packages
installed. Under linux this is a pretty painless progress so I'd
encourage you to give it a go.


On Tue, Mar 8, 2011 at 2:32 AM, Jeremy Price <donomii at gmail.com> wrote:
> Hi,
> I've been working on a Bayes file categoriser, which requires scanning
> files and putting a (very) large number of keys into a hash.  In an
> attempt to speed things up, I tried to save the hash to disk and then
> read it back later.  Creating and saving the hash took less than 5
> minutes, reading it from disk didn't finish after 10 hours.  It seems
> like I may have missed a switch or option, but reading the manual for
> (read) and Data Types doesn't give me any clues.  What did I miss?
> I saved and loaded using:
> (with-output-to-file "/home/user/bayes-data" (lambda () (write
> trained_categories) ))
> (with-input-from-file "/home/user/bayes-data" (lambda () (set!
> trained_categories (read))))
> The saved hash has a size of 167M and looks like:
> #hash( ("files" . #hash((#"\0\0\0\324" . 1) (#"\6\372\370\233" . 1) ... )  ... )
> and I'm using:
> Welcome to MzScheme v4.2.4 [3m], Copyright (c) 2004-2010 PLT Scheme Inc.
> That version is the latest Ubuntu is shipping, so apologies if the
> problem has already been addressed.
> _________________________________________________
>  For list-related administrative tasks:
>  http://lists.racket-lang.org/listinfo/users

Posted on the users mailing list.