Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

RE: Schwartzian Transform vs. plain Perl

by mikfire (Deacon)
on Jun 08, 2000 at 16:38 UTC ( [id://17064]=note: print w/replies, xml ) Need Help??


in reply to Schwartzian Transform vs. plain Perl

The savings generated by the Transform ( too early in the morning to type Schwartzian - sorry merlyn ) is the expensive_func part ( cref) In the archtypical case, that expensive function is hitting the disk for file sizes.

In your benchmarks, there is no "expensive_func". Yes, the hash lookup is a bit more expensive than the array lookup, but not that expensive. The expense of the extra map() is greater than the savings realized by doing the array lookup.

To reap the benefits of the Transform, do something real - like stat some rapidly changing file on your filesystem

HTH,
mikfire

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others pondering the Monastery: (5)
As of 2024-03-28 18:36 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found