Skip to content

simplify xml syntax files before integrating them into the executable to speed up reading

  • transforms boolean values into 0 or 1
  • remove unused attributes (fallthrough, dynamic in , etc)
  • remove spaces and comments
  • remove context attributes referring to #stay (because this is the default)
  • replace Detect2Chars with StringDetect (String="xy" is shorter than char="x" char1="y")
  • sort contexts by frequency of use to accelerate their search during loading
  • sort attributes for better compression by rcc

loading speed comparison with:

./bin/ksyntaxhighlighter6 -fansi -s $language <<<''
_ sh cpp php md latex
before 21ms 24ms 47ms 85ms 190ms
after 20ms 23ms 43ms 75ms 163ms

Library size (after strip command): 1.99M -> 1.75M

Merge request reports

Loading