mastaraymond
2012-12-12 12:32:47
Currently finding colors with CTS 2/CTS 3 is quite CPU-intensive. It translates every colour to another colorspace (HSL/XYZ) and then applies some fancy color-comparing algorithm.
What if we would cache the color compares of colors that are being searched a lot? This would be implemented by a buffer that stores the value for the compare of your color (with CTS X and Tol Y) with every other possible colour. (It only has to store 1 for "does compare" and 0 for "does not compare").
Such a buffer would be quite big in size: 256^3 bits (All the possible RGB combinations) which is around ~2mb. So for every colour+tol+cts we want to cache it will roughly cost 2mb of RAM. Which is not a shitload amount, but it still requires the scripter to think which color would benefit.
The only question is whether this actually speeds-up the colorfinding process. I can imagine that some CPUs are faster calculating the value than waiting on the memory, but then again the current CPUs probably have a cache big enough.
What if we would cache the color compares of colors that are being searched a lot? This would be implemented by a buffer that stores the value for the compare of your color (with CTS X and Tol Y) with every other possible colour. (It only has to store 1 for "does compare" and 0 for "does not compare").
Such a buffer would be quite big in size: 256^3 bits (All the possible RGB combinations) which is around ~2mb. So for every colour+tol+cts we want to cache it will roughly cost 2mb of RAM. Which is not a shitload amount, but it still requires the scripter to think which color would benefit.
The only question is whether this actually speeds-up the colorfinding process. I can imagine that some CPUs are faster calculating the value than waiting on the memory, but then again the current CPUs probably have a cache big enough.