std::future slow

Apr 13, 2018 at 1:16am
Code and tests are here:

https://wandbox.org/permlink/WRrexu49nQ5vnGyb

Is there a reason for this? I'd expect it to have the same performance as the 2nd test (lambda) and almost half the time as the first (which is indeed the case for the lambda).

As far as I know, launch_deferred should not be doing any fancy magic. It should behave similar to std::function
Last edited on Apr 13, 2018 at 1:20am
Apr 13, 2018 at 3:55am
clang gave me there the less outrageous 34049 17024 37675 19496 https://wandbox.org/permlink/LVxqSiAAV8Pan6kx
so the question is more about gcc than about std::future.
If you can reproduce it locally, it's a good demo to use a profiler
(edit: local gcc for me comes up similar to wandbox's clang.. so it's something with wandbox)
Last edited on Apr 13, 2018 at 1:39pm
Topic archived. No new replies allowed.