[mrtg] Re: OT: perl vs shell cmd
Takumi Yamane
yamtak at b-session.com
Tue Jun 14 10:15:27 MEST 2005
On Tue, 14 Jun 2005 15:09:47 +0700, Beast wrote
in <42AE90CB.2080708 at i6x.org>:
>
> Supose I want to parse a big log file (~500MB/4mil lines), which one
> is faster and use less memory:
>
> $ ./parser.pl logfile.log
> $ grep 'Jun 14 03:' | ./parser.pl
IMHO, perl('s regex engine) alone is faster and use less memory.
> if(/^$in_time/) {
It's much better to use 'o' switch, like:
if(/^$in_time/o) {
--
Takumi Yamane <yamtak at b-session.com>
--
Unsubscribe mailto:mrtg-request at list.ee.ethz.ch?subject=unsubscribe
Archive http://lists.ee.ethz.ch/mrtg
FAQ http://faq.mrtg.org Homepage http://www.mrtg.org
WebAdmin http://lists.ee.ethz.ch/lsg2.cgi
More information about the mrtg
mailing list