Skip to content

Fix: Cache ColorsUsed for huge performance boost

Paul Nitzke requested to merge performance into master
  • This greatly increases performance (Many orders of magnite faster)
  • ColorsUsed was implemented so that every time it is queried the value is calculated on the fly
  • When writing ColorsUsed I did not think this would be a problem since we only need it once: When calculating the color
  • But the actual implementation used it at two points so that for x colored nodes the ColorsUsed were calculated twice.
  • This is both cached in ColoredDotWriter and properly calculated in the -Graph classes

Merge request reports