develooper Front page | perl.perl6.internals | Postings from May 2005

Re: wanted: hash stress tests

Thread Previous | Thread Next
From:
Leopold Toetsch
Date:
May 20, 2005 10:33
Subject:
Re: wanted: hash stress tests
Message ID:
428E1FA3.6070007@toetsch.at
Uri Guttman wrote:
>>>>>>"LT" == Leopold Toetsch <lt@toetsch.at> writes:
> 
> 
>   LT> I'm currently rewriting the hash implementation in src/hash.c. The
>   LT> new hash structure has just one piece of malloced memory with
>   LT> bucket pointers and buckets in one piece.
> 
> here is an odd thought to add to that. since your hash is a single hunk
> of ram, you could use offsets inside it instead of pointers. that means
> it could be both shareable (given locks) and even writable to disk. 

I don't see the difference WRT shareable, but yes, the memory hunk could 
be written at once for freezing, which may save some cycles. More 
importantly it doesn't need relocation during hash_expand(), if offsets 
are calculated from start of mem.

With some benchmarks we can see, which is better, but using offsets 
seems to be a good idea.

> uri

Thanks,
leo


Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About