Proposed change to NikonBase fetching events

Post Reply
radeldudel
Posts: 6
Joined: Tue Nov 26, 2013 8:03 am

Proposed change to NikonBase fetching events

Post by radeldudel » Sun Dec 01, 2013 10:42 pm

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

Proposed change to NikonBase fetching events

Advertisment
 

radeldudel
Posts: 6
Joined: Tue Nov 26, 2013 8:03 am

I used the Intel Power Gadget

Post by radeldudel » Mon Dec 02, 2013 10:04 am

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.

Duka Istvan
Posts: 867
Joined: Tue Mar 26, 2013 9:52 pm

Thanks for testing and for

Post by Duka Istvan » Mon Dec 02, 2013 7:28 pm

Thanks for testing and for patch. I applied to the code.

radeldudel
Posts: 6
Joined: Tue Nov 26, 2013 8:03 am

Thanks!

Post by radeldudel » Mon Dec 02, 2013 10:29 pm

Thanks!I hope it will work at least as well as the old one!

Post Reply