The profiling was just a way of finding where your
program was spending most of it's time. Most of the
scripts here are short, but for some larger awk
programs and for tshooting I thought that a profiler
might be very helpful.
You would wrap your script in the profiler script,
exec it and the profiler would keep track of how much
time was spent in each control section.
say this output:
BEGIN { ((1 time))
n = 1000
xarr[0] = 1 ; x = 1
print 2
for (i = 1 ; i <= n ; i++) { ((998 times))
if (prime(i)) { ((167 times))
print i
}
}
exit
}
Have you seen any examples of programs that do this?
The book says that his awk profiler scripts were two five line programs but he doesn't include them...
It was right in front of me the whole time.
Gawk ships with pgawk, doh...
`pgawk' is identical in every way to `gawk', except that when it has
finished running, it creates a profile of your program in a file named
`awkprof.out'. Because it is profiling, it also executes up to 45
percent slower than `gawk' normally does.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.