

And even worse, my laptop gets a bit slower when multitasking. But the result is identical: disabling hyperthreading doesn't help the process to do better. I have even ran the test on my laptop, which takes around twice the time it took on my computer. Gnome-system-monitor reported 50% CPU usage by Ruby while the test was running. LOOPS = ENV.to_i.then /online used to disable hyperthreads ] ⮚ ruby p.rbĬounting till 100000000 and adding values to V. This program should use 100% of a CPU core: #!/usr/bin/env ruby I wrote a simple Ruby script that runs a while loop and adds a the value of the loop counter with another variable. I did a benchmark to see if I really get any performance boost by disabling hyperthreading. So I wanted to make most of the resources available to Ruby. I wanted to see if disabling hyperthreading benefits a programming language that runs on single thread.Īlso, my server is running a very minimal desktop environment and it doesn't use more than 2% CPU. Ruby only utilizes 25% CPU under heavy load. My computer (server) has an Intel i3 dual core processor, but due to hyperthreading I see 4 cores. Because Ruby (2.7) has a GIL, it is single threaded. I have a server that's primarily running a Ruby script.
