Proposed change to NikonBase fetching events
-
- Posts: 6
- Joined: Tue Nov 26, 2013 8:03 am
Proposed change to NikonBase fetching events
I noticed you are using a thread to fetch events in the NikonBase class. There is a small change which would reduce resource consumption of digiCamControl a bit:Use a thread from the ThreadPool instead of creating a new one each time. Creating and destroying threads is (in system speak) an "expensive operatioN", so .NET offers a ThreadPool where you can request threads. Usage is even easier than creating a thread and it should behave exaclty the same (I tried it to make sure and for me it worked nicely).It might even save a bit of power (interesting on Notebooks, could be testet using the Intel Power Gadget).The diff for the changes is attached.Of course you might have reasons to use a thread that I do not know of, so feel free to discard this advice.Cheers,Sam
-
- Posts: 6
- Joined: Tue Nov 26, 2013 8:03 am
I used the Intel Power Gadget
I used the Intel Power Gadget to check the effect of the changes:When using a Thread the power consumption on my notebook was 7-8W.When using the ThreadPool power consumption went down to 3-4W.So effectly this simple change cut my power needs nearly in half.
-
- Posts: 867
- Joined: Tue Mar 26, 2013 9:52 pm
Thanks for testing and for
Thanks for testing and for patch. I applied to the code.
-
- Posts: 6
- Joined: Tue Nov 26, 2013 8:03 am
Thanks!
Thanks!I hope it will work at least as well as the old one!