When I implemented MSVC++'s parallel algorithms I did not parallelize algorithms for which I could not show a meaningful improvement, and almost all of the copy-like algorithms did not show meaningful improvements.
For copy_if specifically I also did not know the algorithm the OP uses and AVX 512 was not something that was likely to be around in 2017. (The 7980XE I used for some testing had it but nothing else to which I had access had, which made trying to do AVX-512 stuff uninteresting in terms of time)
(Also I still consider unseq / par_unseq functionally useless, at least for all the CPU targeting implementations I know of. The explanation I remember about it was that they were supposed to be "like #pragma omp simd" for CPU implementations, but #pragma omp simd weakens the floating point model in ways unseq does not. For things optimizers know how to vectorize, they will vectorize without being asked with unseq / par_unseq. On GPUs where a "thread" taking the wrong branch on something like a spinlock can deadlock the machine, unseq does mean something, but MSVC++'s STL isn't targeting one of those)
View all comments
Show parent comment
2
u/Expert-Map-1126 vcpkg maintainer BillyONeal May 29 '26 edited May 29 '26
When I implemented MSVC++'s parallel algorithms I did not parallelize algorithms for which I could not show a meaningful improvement, and almost all of the copy-like algorithms did not show meaningful improvements.
For
copy_ifspecifically I also did not know the algorithm the OP uses and AVX 512 was not something that was likely to be around in 2017. (The 7980XE I used for some testing had it but nothing else to which I had access had, which made trying to do AVX-512 stuff uninteresting in terms of time)We have the list of outstanding algorithms that might benefit listed over here: https://github.com/microsoft/STL/issues/7
(Also I still consider
unseq/par_unseqfunctionally useless, at least for all the CPU targeting implementations I know of. The explanation I remember about it was that they were supposed to be "like#pragma omp simd" for CPU implementations, but#pragma omp simdweakens the floating point model in waysunseqdoes not. For things optimizers know how to vectorize, they will vectorize without being asked withunseq/par_unseq. On GPUs where a "thread" taking the wrong branch on something like a spinlock can deadlock the machine,unseqdoes mean something, but MSVC++'s STL isn't targeting one of those)