Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer

Re: use File::Slurp for (!"speed");

by ysth (Canon)
on Nov 08, 2004 at 19:22 UTC ( #406181=note: print w/replies, xml ) Need Help??

in reply to use File::Slurp for (!"speed");

To summarize revdiablo's results: if it's going to take more than 1/30000th of a second, File::Slurp is faster; otherwise the idiomatic slurp may be faster. Sounds like the OP here caught a serious case of premature optimization (ironically, while somewhat arguing against it).

There are other ways to measure "efficiency". For instance, I know the difference between $/ and $\, but I'm still prone to mistype one for the other perhaps as much as 1% of the time. The time it takes to identify and correct this is a huge inefficency; just using File::Slurp eliminates this problem, at least in the case of file slurping.

Replies are listed 'Best First'.
Re^2: use File::Slurp for (!"speed");
by YuckFoo (Abbot) on Nov 10, 2004 at 03:56 UTC

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others browsing the Monastery: (6)
As of 2019-10-23 05:52 GMT
Find Nodes?
    Voting Booth?