in reply to Re^2: Threads From Hell #2: How To Parse A Very Huge File
in thread Threads From Hell #2: How To Search A Very Huge File [SOLVED]
"...User code time... + system code time... = real time..."
Yes:
From the docs:
"The time utility executes and times the specified utility. After the utility finishes, time writes to the standard error stream, (in seconds): the total time elapsed, the time used to execute the utility process and the time consumed by system overhead."
Some observations:
karls-mac-mini:monks karl$ ls -hl very_huge10GB.file -rw-r--r-- 1 karl karl 10G 25 Mai 00:53 very_huge10GB.file karls-mac-mini:monks karl$ time grep karl very_huge10GB.file nose cuke karl nose cuke karl nose cuke karl nose cuke karl nose cuke karl real 2m42.126s user 0m20.437s sys 0m5.645s
karls-mac-mini:monks karl$ ./mce_loop.pl nose cuke karl nose cuke karl nose cuke karl nose cuke karl nose cuke karl Took 150.555 seconds
#!/usr/bin/env perl use Time::HiRes qw( time ); use feature qw(say); my $start = time; say qx (grep karl very_huge10GB.file); printf "Took %.3f seconds\n", time - $start; __END__ karls-mac-mini:monks karl$ ./wrap.pl nose cuke karl nose cuke karl nose cuke karl nose cuke karl nose cuke karl Took 157.265 seconds
For the grep example 60+60+42=162 which is 2m42s. But user+sys (20+5) is 0m25s. What do i miss?
Perhaps it's too late tonight. Or too early in the morning?
Best regards, Karl
«The Crux of the Biscuit is the Apostrophe»
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^4: Threads From Hell #2: How To Parse A Very Huge File
by marioroy (Prior) on May 25, 2015 at 00:28 UTC | |
Re^4: Threads From Hell #2: How To Parse A Very Huge File
by BrowserUk (Patriarch) on May 25, 2015 at 01:00 UTC | |
by karlgoethebier (Abbot) on May 26, 2015 at 10:35 UTC | |
by BrowserUk (Patriarch) on May 26, 2015 at 10:53 UTC | |
by karlgoethebier (Abbot) on May 26, 2015 at 19:47 UTC | |
by marioroy (Prior) on May 29, 2015 at 12:13 UTC | |
|