On 19.04.2007, at 22:02, Jerry D. Hedden wrote: [possible speed hack] > That sounds interesting. Again, perhaps it could be added > as an optional feature. (Would you mind sending me the code > so I could marvel at it? Thanks.) Right. Here is a version of HUF that optionally applies the technique. You need a reasonably recent bleadperl for the build. Then cd bench_Hedden bleadperl -Mblib set.pl # etc. The (modified) base.pl shows how to create a FieldHash in "fast" mode (Hash::Util::FieldHash::_fieldhash \ my %h, 2). Class FieldHash_f in base.pl does this. Good job, your little benchmark kit. It ran immediately and was straightforward to modify. Nice tight code. On my machine, FieldHash_f still falls short of Refaddr by -10% in set actions, but is much better than the -40% of the current version. No effect on get (expected), where it's equal to Refaddr. I am still undecided if the change is worth the complication and potentially unsafe operation that comes with it. On the one hand, I'm not quite sure how unsafe it actually is. Under certain conditions, object registry can be bypassed. On the other hand, I'd like to run benchmarks that show the impact on one or two more typical classes. I expect it to be rather small. Thanks to your initiative I have now a version of HUF that allows these tests. Regards, AnnoThread Previous | Thread Next