yumetodo / SigContrastFastAviUtl

Sigmoidal/Logit contrast Aviutl plugin. IM is not used.
MIT License
2 stars 0 forks source link

consider to use C++17 parallel algorithms #25

Open yumetodo opened 3 years ago

yumetodo commented 3 years ago

As already mentioned at #23 , The cost of creating/destroying thread is expensive. C++17 introduce C++17 parallel algorithms. MSVC's implementation use threadpool. So, instead of adapting Intel TBB(#23), we can use it.

Also, some unit test is too slow so that we can speed up by using C++17 parallel algorithms

Using C++17 Parallel Algorithms for Better Performance | C++ Team Blog

Scheduling in our implementation is handled by the Windows system thread pool. The thread pool takes advantage of information not available to the standard library, such as what other threads on the system are doing, what kernel resources threads are waiting for, and similar. It chooses when to create more threads, and when to terminate them. It’s also shared with other system components, including those not using C++.

For more information about the kinds of optimizations the thread pool does on your (and our) behalf, check out Pedro Teixeira’s talk on the thread pool, as well as official documentation for the CreateThreadpoolWork, SubmitThreadpoolWork, WaitForThreadpoolWorkCallbacks, and CloseThreadpoolWork functions.

yumetodo commented 3 years ago

https://1drv.ms/x/s!Aq2AEiq89cYUq1VLPYguRoG69X8H?e=o1C1FT 🤔

yumetodo commented 3 years ago

image Why do these changes affect speed???