mirror of
https://github.com/storytold/vectorcraft.git
synced 2026-11-17 15:26:12 +00:00
Saving a legacy .ai file numbered a gradient definition whose name was taken by searching every definition written so far for each number it tried, so a document with many distinct gradients without a swatch name spent time cubic in their count naming them. Spot color names were numbered the same way. Both now keep the names given in a set and, for each name, the number to try next. Names are never given back, so every number below that counter is still taken, and the file is the same as before: the first free "Name 2", "Name 3" and so on, with equal gradients sharing a definition. - New tests compare the counters with a search of the names given over 3,000 names, and the whole written file both ways for colliding gradient and spot color names. - An ignored timing test writes 1,504 gradient definitions: in release on Linux, the median of 7 runs took 23 ms of thread CPU time against 1,163 ms for the search.