Mailing List Archive
tlug.jp Mailing List tlug archive tlug Mailing List Archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][tlug] Giving a program priority briefly
- Date: Sun, 10 Jun 2007 10:57:27 +0900
- From: Darren Cook <darren@example.com>
- Subject: [tlug] Giving a program priority briefly
- User-agent: Thunderbird 1.5.0.10 (X11/20070301)
I'm refactoring a carefully optimized C++ program, 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 I know I got the -20 bit right as my music froze up, as did the console, for those 5 seconds. My question/problem is that the three benchmarks often give different timings, and the timings vary between runs. It seems roughly related to system load. When "w" tells me system load is higher the benchmark runs slightly slower. (And the variation between the three benchmarks of a single run is less than between runs under different system load.) Would "single user mode" give me full speed? Is there a way to move a system into that mode, run the test, then move back into my gnome desktop with all applications still open, with the flick of a switch? Any other suggestions? I wondered about emulators that count clock cycles, but would fail to take into account CPU cache wouldn't they? Darren -- Darren Cook http://dcook.org/mlsn/ (English-Japanese-German-Chinese free dictionary) http://dcook.org/work/ (About me and my work) http://dcook.org/work/charts/ (My flash charting demos)
- Follow-Ups:
- Re: [tlug] Giving a program priority briefly
- From: Josh Glover
- [tlug] Giving a program priority briefly
- From: Stephen J. Turnbull
- Re: [tlug] Giving a program priority briefly
- From: Nguyen Vu Hung
- Re: [tlug] Giving a program priority briefly
- From: Curt Sampson
Home | Main Index | Thread Index
- Prev by Date: [tlug] /home partition use
- Next by Date: Re: [tlug] /home partition use
- Previous by thread: Re: [tlug] /home partition use
- Next by thread: Re: [tlug] Giving a program priority briefly
- Index(es):
Home Page Mailing List Linux and Japan TLUG Members Links