Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Re^8: A Scalar::Util::refaddr Oddity

by xdg (Monsignor)
on Sep 27, 2005 at 15:43 UTC ( [id://495417]=note: print w/replies, xml ) Need Help??


in reply to Re^7: A Scalar::Util::refaddr Oddity
in thread A Scalar::Util::refaddr Oddity

I'm trying to remember to benchmark more myself. Some quick benchmarking I did suggests they're all within the margin of error. Rest deleted

Update: Error is in front of keyboard. There's a big difference if I actually write my benchmark code correctly.

(Each loop did a refaddr on one object, one hash ref, and one ref to a constant.)

# overload used on object Rate bless_regex strval_0+ bless_0+ bless_regex 12921/s -- -34% -37% strval_0+ 19557/s 51% -- -5% bless_0+ 20495/s 59% 5% -- # no overloading ( and overload not loaded ) Rate bless_regex bless_0+ strval_0+ bless_regex 13504/s -- -35% -93% bless_0+ 20766/s 54% -- -90% strval_0+ 206767/s 1431% 896% -- # bless_regex: fixed PP version from Scalar::Util to store package usi +ng PP blessed, and only rebless if reference is blessed # bless_0+: same as above, but use 0+$ref instead of regex extraction # strval_0+: if overload loaded and reference is overloaded, use StrVa +l to extract with regex, otherwise, use 0+$ref

-xdg

Code written by xdg and posted on PerlMonks is public domain. It is provided as is with no warranties, express or implied, of any kind. Posted code may not have been tested. Use of posted code is at your own risk.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://495417]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others avoiding work at the Monastery: (3)
As of 2024-04-26 02:24 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found