cs0x7f / min2phase

Rubik's Cube Solver. An optimized implementation of Kociemba's two-phase algorithm.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

multi-thread performance vs single thread performance

terencechow opened this issue · comments

I'm trying to understand the performance difference from the 2 options.

When I ran the multi-threaded test I got an average speed of ~1.5 ms (I have 8 cores). In contrast the average speed of the single thread test is ~0.6ms. That's seems like a significant difference. I wonder if the multi-threaded solution can be optimized to have speeds closer to the single threaded test? I suspect whatever is being synchronized / re-used across threads could just be duplicated (at the cost of more memory). Is this something you'd be interested in? If so if you provide some guidance on where to start looking, I can give it a look

There are amounts of factors that might affect the performance degradation when use multi-threading. Most of them depends on CPU archtechture, e.g. cache miss rate, branch prediction miss rate, cpu frequency, exection unit load (especially memory access unit).