[plt-scheme] Effect of caching using hash-tables vs vectors

From: Matthew Flatt (mflatt at cs.utah.edu)
Date: Sun Mar 18 20:42:42 EDT 2007

At Sat, 17 Mar 2007 16:17:43 -0400 (EDT), Daniel Yoo wrote:
> Using vectors as my lookup structure: I timed about 3 seconds here!  It 
> was just out of curiosity that I redid the macro to use hash-tables, and 
> that's where the performance results surprised me: the vector lookup went 
> much faster than the hash-table approach.
> I was wondering if this is consistent with what other people would expect 
> as far as hash-table performance is concerned: I did expect an overhead in 
> comparing hash-tables to vectors as lookup structures, but not such a 
> large one.

The big difference, I think, is that `vector-ref' and `vector-set!' are
partially inlined by the JIT (and the non-inlined part is invoked with
a special calling convention). Is the difference is much smaller when
you disable the JIT?


Posted on the users mailing list.