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

R (tilly) 3: Expand your world

by tilly (Archbishop)
on Aug 20, 2000 at 11:30 UTC ( [id://28711]=note: print w/replies, xml ) Need Help??


in reply to RE: RE (tilly) 1: Expand your world
in thread Expand your world

If you have a long list of arguments, it will be.

First of all evals don't cost much more than just having had that much code in the first place. Secondly all of the evals take place up front. So it is just like having a longer program.

But at runtime I have a hash lookup (constant time no matter how large the hash is) rather than repeated tests, So I have traded compile time away for faster run-time behaviour.

FWIW I first realized the importance of this win when trying to speed up a program that categorized states into ACLI regions for a huge amount of text information. Just moving the logic out of if/elsif/elsif/else type constructs into hash lookups and/or smart REs was an order of magnitude improvement.

Cheers, Ben

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others learning in the Monastery: (2)
As of 2024-04-26 03:16 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found