in reply to Re: command line perl reading from STDIN
in thread command line perl reading from STDIN
Yeah, typically I do the same, however, in this case although both pieces of code do the same thing there is a massive run time difference.
The file that I'm using is 107,259,832 lines long and the other 63 files I have are between 100 million lines and 200 million lines long. When running the original (utilising cat and piping this to perl) command and piping the output to a just 'wc -l' it took about a minute. With the change to your command structure it has taken about 15 mins so far and is still running.
I'm not entirely sure why this is the case (probably to do with how perl handles files vs STDIN), but I thought it is something you should be aware of. Especially if anyone is working with files in the order of 100s of millions of lines long, and if this is typically the case.
The file that I'm using is 107,259,832 lines long and the other 63 files I have are between 100 million lines and 200 million lines long. When running the original (utilising cat and piping this to perl) command and piping the output to a just 'wc -l' it took about a minute. With the change to your command structure it has taken about 15 mins so far and is still running.
I'm not entirely sure why this is the case (probably to do with how perl handles files vs STDIN), but I thought it is something you should be aware of. Especially if anyone is working with files in the order of 100s of millions of lines long, and if this is typically the case.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^3: command line perl reading from STDIN
by choroba (Cardinal) on Jan 31, 2013 at 17:25 UTC | |
by perlhappy (Novice) on Jan 31, 2013 at 18:06 UTC | |
by BrowserUk (Patriarch) on Jan 31, 2013 at 18:24 UTC | |
by perlhappy (Novice) on Jan 31, 2013 at 18:58 UTC | |
by BrowserUk (Patriarch) on Feb 01, 2013 at 05:15 UTC | |
by tye (Sage) on Jan 31, 2013 at 19:11 UTC | |
by perlhappy (Novice) on Feb 01, 2013 at 14:54 UTC |
In Section
Seekers of Perl Wisdom