Menu

#158 Speed up patterns by saving compiled versions

None
closed-accepted
nobody
None
5
2019-08-06
2019-08-05
Eric
No

In profiling sphinx-build on a project of mine, I noticed a lot of time was spent in re.compile in docutils/statemachine.py. This patch makes it so that only about 20 re.compile calls are made during my whole doc build instead of (tens or hundreds of?) thousands.

It cuts my total sphinx-build doc build time from 4m56s to 4m25s. Not phenomenal, but 5-10% overall speedup seems worth it for a simple change.

I usually use git and GitHub for changesets, apologies in advance if my patch is malformed. I just did git diff > speedup.patch.

1 Attachments

Discussion

  • engelbert gruber

    patch format is fine .
    inside docutils patch -p1 < speedup.patch

     
  • engelbert gruber

    • status: open --> closed-accepted
     
  • engelbert gruber

    thanks

     

Log in to post a comment.

MongoDB Logo MongoDB