Skip to content

major speed improvements

Victor Engmark requested to merge hackerb9:master into master

Created by: hackerb9

Previous code was linear and takes over four seconds to run. The more colors a terminal has, the longer the old code would take.

New version uses binary search and is 10x faster. Since we'll be checking colors that may be above the maximum, the 'read' command now has a timeout of 0.1 seconds.

Note that the code for printing all the colors does not seem to work as one might expect, but that's not a new bug.

Merge request reports