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

Re^4: cut vs split (suggestions)

by tlm (Prior)
on Apr 17, 2005 at 04:30 UTC ( #448577=note: print w/ replies, xml ) Need Help??


in reply to Re^3: cut vs split (suggestions)
in thread cut vs split (suggestions)

That said, that time for your cut seems almost to good to be true. You are sure that cut can't somehow detect that it is writing to the null device and simply skip it--like perl sort detects a null context and skips?

As it happens, in the very first run of cut I tried, I sent the output to a file; and yes, I was pleasantly surprised to see how fast this cut was. But, what utility could there be for the optimization you describe? If there is one, I sure can't think of it. And why should a no-op take 0.9s?

Anyway, FWIW:

% time cut -d, -f"1-15" numbers.csv > out.csv 0.80s user 0.11s system 100% cpu 0.906 total % wc out.csv 500000 500000 29174488 out.csv % head -1 out.csv 169,970,983,721,411,426,262,255,484,174,389,651,175,975,763 % tail -1 out.csv 936,347,232,520,436,359,208,737,788,226,731,497,755,746,812

the lowliest monk


Comment on Re^4: cut vs split (suggestions)
Download Code
Re^5: cut vs split (suggestions)
by BrowserUk (Pope) on Apr 17, 2005 at 04:47 UTC
    But, what utility could there be for the optimization you describe?

    None, but then there is no point in sorting in a void context either, but I've been bitten enough times by that when benchmarking (usually publically!), that extreme differences make me suspicious. I was just suprised by the magniitude of the difference you were showing.


    Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
    Lingua non convalesco, consenesco et abolesco.
    Rule 1 has a caveat! -- Who broke the cabal?

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others chilling in the Monastery: (6)
As of 2014-07-25 23:37 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite superfluous repetitious redundant duplicative phrase is:









    Results (175 votes), past polls