addcolor(colors) is very slow when length(colors) is big
Reported by Samuel GOUGEON (@sgougeon)
-- Bug description --
addcolor(colors) is very slow when length(colors) is big.
An improved implementation is attached: 65s => 6.2s for length(colors)=300000, containing and adding to the default colormap ~530 new distinct colors.
This improvement is of first importance for sharing the same colormap by several images in the same figure (see http://atoms.scilab.org/toolboxes/IPD/8.0#comment1392 )
-- Scilab error message --
-- How to reproduce the bug --
Created an attachment (id=2333)
Improved addcolor() macro (speed x ~10)
c = grand(300000,3,"uin",0,7)*36/255; // Generating colors to be scanned and added
scf(); tic(), n = addcolor(c); toc()
// Now compile the patch. Then:
scf(); tic(), n = addcolor(c); toc()