JakeRoggenbuck / auto-clock-speed

A utility to check stats about your CPU, and auto regulate clock speeds to help with either performance or battery life.
https://autoclockspeed.org
MIT License
33 stars 9 forks source link

See if files can be held open as references. #466

Open JakeRoggenbuck opened 1 year ago

JakeRoggenbuck commented 1 year ago

A lot of the read int and read string, which make up a large part of the daemon update call is spent opening and closing files often. This time can be seen in read_int in green. image

Here is how much of update read_int and read_str account for. image

If we saved the files opened as refs, we could remove all of the open/close (blue) blocks in the update (green). image