PeterFeicht / cppreference-doc

C++ standard library reference
en.cppreference.com
GNU General Public License v3.0
577 stars 47 forks source link

Preprocessing cssless is incredibly slow #6

Closed PeterFeicht closed 6 years ago

PeterFeicht commented 6 years ago

Preprocessing a single file for the cssless QCH files takes a couple of seconds on my reasonably fast machine, which means a release build will take hours instead of seconds.

One of the hotspots seems to be repeated parsing and dumping of CSS styles from the style DOM element property and back. A possible improvement would be to just use regular expressions for handling most CSS manipulation, if we can make sure that the actual CSS is simple enough for that to work.

PeterFeicht commented 6 years ago

I made an attempt to solve this by using regular expressions, but my PR was rejected upstream. Instead we're now using a cache for CSS parsing results, which improves performance quite a bit.