Mailing List Archive


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [tlug] Giving a program priority briefly



On Sun, 10 Jun 2007, Darren Cook wrote:

...trying to make sure I don't slow it down.
It has a stdin interface and a benchmark command can
be sent. I'm sending the benchmark command three times, which in total
takes about 5 seconds.

I found it ran notably faster when I became root and used nice as follows:
 cat commands.txt | nice -n -20 ./myprog

Try "cat commands.txt | time ./myprog" and examine the "user" and "system" time figures, ignoring the "real" (wall clock) time. Ideally, run this two or three times, and make sure you're using at least a second of CPU time each time.

You'll probably get much more consistent times from this, even if your
real time varies a lot based on load. This, while far from perfect, is a
fine method of making sure you haven't screwed up something big time as
you make changes.

If that doesn't work for you, because you've got important cache issues,
or you need to benchmark disk I/O as well, or whatever else, well, now
you've probably got a lot more work cut out for you.

cjs
--
Curt Sampson       <cjs@example.com>        +81 90 7737 2974
Mobile sites and software consulting: http://www.starling-software.com


Home | Main Index | Thread Index

Home Page Mailing List Linux and Japan TLUG Members Links