Performance improvements with kernel/OS update
- Inicie sesión ou rexístrese para enviar comentarios
As an experiment, I wrote a solution to the N-queens problem in Ruby and recorded some benchmarks a couple of years ago (Trisquel 10 Nabia). To take advantage of multi-core CPUs, I thought it would be a good idea to try a concurrent approach with threads. Due to the global interpreter lock in Ruby MRI, performance actually worsened compared to the linear (single thread) approach. But with JRuby (JVM), there were significant gains in performance.
Anyhow, I decided to run the benchmarks again on a whim recently (Trisquel 11 Aramo), and was surprised with the results on the same exact machine and the same exact versions of JRuby and the JVM. The test machine has a 4-core Intel Celeron CPU.
(Trisquel 10 Nabia)
user system total real
n=10, threads=4 294.540000 5.230000 299.770000 ( 77.967659)
n=10, threads=8 274.290000 2.070000 276.360000 ( 72.522925)
n=10, threads=16 270.090000 1.890000 271.980000 ( 72.017733)
(Trisquel 11 Aramo)
user system total real
n=10, threads=4 188.110000 0.630000 188.740000 ( 50.525707)
n=10, threads=8 189.620000 1.580000 191.200000 ( 52.370422)
n=10, threads=16 189.530000 1.410000 190.940000 ( 54.858695)
Is this kind of performance improvement to be expected with kernel and OS updates or are there other contributing factors?
I wonder what program you used to measure the performance.
I think performance sometimes is difficult to measure because there are other programs running on the machine?
I used the built-in Benchmark module in Ruby. The "system" column represents kernel execution time whereas the "user" column represents the program execution time. The "real" column values are smaller here since the execution time is split between multiple cores. For what it's worth, the machine was mostly idle when I ran the benchmarks but other programs running should not matter if we're looking at the "user" column.
One possible factor I can think of is the "kidle_inject" processes which the kernel spawns to prevent overheating. But this was only observable when I increased N to 12. The machine is passively cooled and CPU temperatures can get high when pushed but can easily be lowered by an external fan.

