Ryochan7 / DS4MapperTest

GNU General Public License v3.0
7 stars 2 forks source link

Single App Instance Check #16

Closed Ryochan7 closed 9 months ago

Ryochan7 commented 1 year ago

It might be time to re-implement a single instance check. Need to make sure that such a check does not affect app performance.

Ryochan7 commented 1 year ago

I stumbled on a way to improve the single app check that is used in DS4Windows. Instead of using EventWaitHandleAcl.OpenExisting and catching exceptions, now EventWaitHandleAcl.TryOpenExisting is being used so exception handling is no longer needed. Such a small change led to a great performance boost.

It is frustrating how such small changes to an app running on .NET can affect the performance of the entire application despite being only a short run routine. The new version that will be included in the next DS4Windows (3.2.13) will likely be used in this project.

https://github.com/Ryochan7/DS4Windows/commit/f93a03724f28c1a3db37c3f01c783c0ab3fad67d