[parrot-tickets] [Parrot] #780: [RFC] deprecated parrot_new_pointer_hash and parrot_new_cstring_hash

Vasily Chekalkin bacek at bacek.com
Mon Jun 22 14:42:40 UTC 2009


chromatic wrote:
> On Monday 22 June 2009 03:22:56 Vasily Chekalkin wrote:
> 
>> a) 1 usage of cstring Hash in string/api.c for constants. Can be easily
>> converted to  normal STRING*. (Thinking little bit) Hey. What about
>> unicode constants? Especially UCS2?
> 
> That code uses that cache to *avoid* creating new STRINGs when something wants 
> a new constant STRING.  If you make it a STRING hash, you might as well remove 
> it.

Ah. Ok. Missed this.

OTOH behaviour of cstring Hash isn't protected from, for example, 
dlclose calls.

> Benchmark it if you do.

I hope that our GC can create simple STRING* faster than hash lookup 
over 992 elements with very expensive byte access to calculate 
hash-value for cstring. But I'll benchmark it it anyway before do it.

-- 
Bacek


More information about the parrot-dev mailing list