Skip to content

Speed up S-Expression handling

jaseg requested to merge neinseg/kicad-library-utils:pr-sexp-speedup into master

Previously, the symbol library S-Expression serialization code would first generate a linebreak-less sexpr, which it would then slowly take apart using a regex, and then re-assemble with indentation and linebreaks. Now, it just builds the sexpr with proper indentation in the first place.

This commit changes the output optically, but the new symbol files are still perfectly human-readable, and KiCad also has no trouble with them.

Writing the STM32H7 library, runtime previously was ~4 min for sexpr writing only. Now, sexpr writing takes less than only 1.3 s. Library loading is also sped up by 25%.

This MR is recommended before merging !444 (merged)

Merge request reports