, 1 min read
Counting to Ten on Linux
Very good article by Bruce Dawson on timing CPU bound application.
- Using $(expr) to do math is over a hundred times slower than using bash internals. This is not a new discovery, but it’s worth reiterating.
- Excessive use of sub processes (see point 1) can confuse the Linux kernel’s power management algorithms, leading to an additional three times slowdown. Interesting…
- time gives accurate elapsed time information but its CPU time information should not be trusted, especially if you make excessive use of sub processes (see point 1). Interesting…
- When time lies you can always use the Windows Task Manager to measure Linux CPU consumption. Amusing.
- Looping in Windows batch files can be faster than looping in Linux shell scripts.
- Process creation in Windows is slower than on Linux. Not surprising.