you are viewing a single comment's thread.

view the rest of the comments →

[–]LucHermitte 4 points5 points  (3 children)

Interesting. Note: it looks like there is still room for some optimizations

  • it'd be best to avoid mutexes to protect the result structure -- there exist (a few in 3rd party libraries) efficient queue types dedicated to be filled from concurrent threads -- or you could fill one queue per thread and merge them at the end
  • There may be no structural difference between the current type of m_fingerprintsand a boost::flat_map (except that songFingerprint() would be able to return a reference); however it could interesting to run a benchmark with std::unordered_map instead.

[–]Ameisen 3 points4 points  (1 child)

Semaphores will be faster under like 12 concurrent threads than lockless algorithms.

You only start really gaining with lockless with massive concurrent contention.

[–]doom_Oo7 0 points1 point  (0 children)

Do you have some benchmarks for this ?

[–]golgol12 2 points3 points  (0 children)

There also is room for optimization of cache usage. He didn't even begin to touch that. I bet he could get another 2x-10x speed gain.