I made some basic multi-threading tests here, and noticed that the speed increase when using the exact is bigger than I expected.
I assumed that speed would increase linearly until I hit the limit of cores, and then either stop increasing, or even slow down.
Instead speed increases linearly, and then JUMPS upward, but on the next amount of thread (1+ than the machine have cores), it "continues" from where it was before.
A graph for example looked like a long linear function, with a gigantic spike in the middle, where I had same number of threads as cores.
So, why is that?
PS: before someone point out the obvious (that using the number of cores of the CPU mean using the maximum of the CPU), I already know the obvious, I am asking about the non-obvious.
EDIT: graph made in R, it is how many "turns" the simulator can run per MS.
The algorithm there is running through an array of agents, then doing some floating-point math, doing some comparisons with turn number, and then calling a function that do more floating-point math, on the test of the graph the function wasn't inlined.
Same program, but with "release" build.
Also, I would like to note that "threads" here refer to worker threads, there is also an UI+Boss thread that updates as fast as OpenGL allows, seemly this became important on the MacMini, since the graph looks like "off by one"
Here is the MacMini performance alone, its CPU is a i5-2415M 2.3Ghz (with 2.9Ghz boost) 2 cores + HT.
Here is Zephyr's performance + MacMini on the bottom of the graph, its CPU is a i5-4690K with Intel's stock behaviour, it has 4 cores, but doesn't have HT.