openvdb icon indicating copy to clipboard operation
openvdb copied to clipboard

[REQUEST] std::deque on MSVC degenerates to a vector of pointers

Open bubnikv opened this issue 3 years ago • 2 comments

I would like to point out to a performance issue on MSVC, where std::deque degenerates to a vector of pointers for all practical purposes. https://github.com/microsoft/STL/issues/147#issuecomment-1090148740

It may be a good idea to typedef an OpenVDB::deque to boost::container::deque for performance gains on Windows.

bubnikv avatar Apr 07 '22 14:04 bubnikv

Thank you for the heads up!

Unfortunately, we are trying to get away from boost, instead trying to move to std:: methods where possible. So stepping backwards for MSVC isn't very desired.

A PR to have an openvdb::deque would be interesting though, and allow more flexibility of how this is implemented.

Do you have timings of sections that run slower under std::deque than a replacement?

Note we are also relying on deque's block-approach in some cases.

jmlait avatar Apr 12 '22 17:04 jmlait

Do you have timings of sections that run slower under std::deque than a replacement?

Sorry we did not do much profiling. I just stumbled over the Microsoft implementation issue, so I was quick to let you know. In our software where we already use boost, we did what I proposed: we typedef deque in our namespace either to std::deque or boost::deque.

bubnikv avatar May 17 '22 15:05 bubnikv