Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Re: cut vs split (suggestions)

by jZed (Prior)
on Apr 17, 2005 at 05:47 UTC ( #448595=note: print w/replies, xml ) Need Help??


in reply to cut vs split (suggestions)

Well, there's always that middle ground between C and perl - XS modules. Cut probably still beats it, but Text::CSV_XS appears to be faster than split for files of that size. And has the added advantage of supporting embedded newlines and embedded delimiters.

For a 1 million row table of 100 columns, sum the second column:

             s/iter        Split Text::CSV_XS
Split          49.8           --          -8%
Text::CSV_XS   45.9           8%           --

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://448595]
help
Chatterbox?
[Corion]: Yeah, I also went a more roundabout way, just to find that the solution had been with Perl all along! ;)
[tye]: perhaps the "less secure" comment was motivated by old versions of getlogin() and trolled through the 'last' log trying to match your TTY. On modern Unix, I believe getlogin() just returns a fundamental bit of identity from your process.
[tye]: (Because every thing you do has that tag available for auditd.)
[tye]: Though it is certainly true that you should not use getlogin() for auth().
[LanX]: tye: just a tip for the next time, I found interesting things there...
[LanX]: like shmem commands : shmctl, shmget, shmread, shmwrite...

How do I use this? | Other CB clients
Other Users?
Others studying the Monastery: (6)
As of 2017-06-23 18:58 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    How many monitors do you use while coding?















    Results (554 votes). Check out past polls.