C++ Parallel STL Benchmark

C++ includes a standard set of generic algorithms, which used to be called STL (Standard Template Library). On Windows, Microsoft provides parallel versions of standard algorithms, listed below with the first argument being std::. Also, Intel provides parallel version of standard algorithms, listed below with the first argument being dpl::.

The following Table shows performance of single-core serial and multi-core parallel algorithms on a 14-core i7-12700 laptop processor when processing an array of 100 Million 32-bit integers:

Algorithmsequnseqparpar_unseq
copy(std::3395n/s33173080
copy(dpl::2865251832504181
count(std::3758n/s75418403
count(dpl::3284305860838850
fill(std::3030n/s31253056
fill(dpl::2795288942686459
merge(std::142n/s153155
merge(dpl::15615514501431
sort(std::11 n/s7374
sort(dpl::1111109107
stable_sort(std::12 n/s4444
stable_sort(dpl::1012115117

The following Table shows performance of single-core serial and multi-core parallel algorithms on a 48-core Intel Xeon 8275CL AWS node when processing an array of 100 Million 32-bit integers:

Algorithmsequnseqparpar_unseq
fill(std::n/s
fill(dpl::278928042918992-
sort(std::10 n/s7381
sort(dpl::99165162
stable_sort(std::10 n/s6363
stable_sort(dpl::1010161163

seq – sequential single-core version

unseq – single-core SIMD/SSE vectorized

par – multi-core version

par_unseq – multi-core SIMD/SSE vectorized

n/s – not supported – i.e. variation not implemented

Benchmark Environment

The above benchmarks were performed using VisualStudio 2022 built in release mode using Intel C++ compiler and Intel OneAPI 2023.1 environment. This enabled access to both Microsoft std:: implementations and Intel dpl:: implementations. Benchmarks were run on Windows 11.

Advertisement

One thought on “C++ Parallel STL Benchmark

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s