I have made a repository that contains a collection of projects that benchmark high performance multithreaded implementations of common algorithms. It's a CMake project that compiles both the serial and concurrent versions of the project.
Right now, I have only managed to upload a project that benchmarks the filter algorithm. The algorithm simply copies elements from one array to another if the element meets a cetain condition. In this case, it checks numbers from the array to see if it is below a certain threshold and copies it over if so.
The multithreaded implementation is pretty basic as far as high performance multithreaded code go. I ran it on my quad core hyperthreaded i7 and the results are quite satisfying. It helps to show the capabilities of multithreading and its potential in the future as we get more and more cores in our CPUs. Hopefully it manages to run as well on your CPU as it did on mine. It should work even if you have a single core CPU but really, what's the point of running this on a CPU like that.
I'll upload the merge sort and quick sort project once I'm done optimizing them.
Multithreading benchmarks
-
- Posts: 5
- Joined: April 19th, 2019, 7:52 pm
Re: Multithreading benchmarks
Im curious how this would compare using reduce with copy_if and back_inserter into a reserved vector. Or for sorting sort. The c++ 17 versions have an execution policy parameter that you can specify multithreaded.
Re: Multithreading benchmarks
Am I losing my mfing mind
I swear I posted last night about std::copy_if and execution policy.
I swear I posted last night about std::copy_if and execution policy.
Chili
-
- Posts: 4373
- Joined: February 28th, 2013, 3:23 am
- Location: Oklahoma, United States
Re: Multithreading benchmarks
@chili, Maybe you posted it to discord?
If you think paging some data from disk into RAM is slow, try paging it into a simian cerebrum over a pair of optical nerves. - gameprogrammingpatterns.com
Re: Multithreading benchmarks
Nah, twas on this thread. But must not have hit submit or something.
Chili
- cyboryxmen
- Posts: 190
- Joined: November 14th, 2014, 2:03 am
Re: Multithreading benchmarks
I added another executable to the build to benchmark the STL. It only preformed slightly better than the basic serial algorithm. Also, the debugger shows that no additional threads were launched when executing. Maybe Visual Studio doesn't support it?
Zekilk