-
-
Notifications
You must be signed in to change notification settings - Fork 89
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: Cache some results of re.finditer (#969)
* fix: Cache some results of re.finditer If a file is formatted, the code attempts to extract the ignored blocks or unformatted blocks several times from the same HTML string. This commit adds a cache for the unique combination sha256(html || config.REGEX). It stores the results as [(begin,end)], as it seems like the accessing .start() or .end() is somewhat costly. (Same applies for the match that is given as argument) * fix: Inline any It took a huge amount of time. With this patch the amount of time needed for https://github.com/openedx/edx-platform goes from 26s to 18s, so 30% less
- Loading branch information
Showing
1 changed file
with
64 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters