Problems? Is your data what you think it is? | |
PerlMonks |
Re^2: Bidirectional lookup algorithm? (poor XS solution)by shmem (Chancellor) |
on Jan 11, 2015 at 20:27 UTC ( [id://1112906]=note: print w/replies, xml ) | Need Help?? |
That line below your signature is somewhat enigmatic: The code present a class:BiMap, which supports the following methods: 7 ) { strncpy( (char*)( iHash script for RAD and testing), and a brief description. , CLEAN_AFTER_BUILD =used, newSize ); for( i = 0; i = pair; bm--1 I've tried setting up a bidirectional hash using XS code. It makes both key and values into keys and misuses the IV slot of SV of a hash entry to store the pointer to the crossover hash key. However, the benchmarks are disappointing:
Improvement of 22% in memory and more than double time for lookup? Why? Is it due to method call/XS overhead? XS code below. <Reveal this spoiler or all in this thread>
perl -le'print map{pack c,($-++?1:13)+ord}split//,ESEL'
In Section
Seekers of Perl Wisdom
|
|