Screen.reading is computed lazily when it is read. It is currently also computed every time that the property is read. This is bad as the histogram computation is quite expensive.
Solution: Cache the result of the histogram computation in separate variable and return that the next time Screen.reading is called.
Screen.reading
is computed lazily when it is read. It is currently also computed every time that the property is read. This is bad as the histogram computation is quite expensive.Solution: Cache the result of the histogram computation in separate variable and return that the next time
Screen.reading
is called.