New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Speed up JSON and reduce HTML formatter consumption #1569
Merged
Merged
Commits on Oct 11, 2020
-
Update the JSON-LD keyword list to match JSON-LD 1.1
Changes in this patch: * Update the JSON-LD URL to HTTPS * Update the list of JSON-LD keywords * Make the JSON-LD parser less dependent on the JSON lexer implementation * Add unit tests for the JSON-LD lexer
Configuration menu - View commit details
-
Copy full SHA for 61de3c3 - Browse repository at this point
Copy the full SHA 61de3c3View commit details -
Add unit tests for the JSON parser
This includes: * Testing valid literals * Testing valid string escapes * Testing that object keys are tokenized differently from string values
Configuration menu - View commit details
-
Copy full SHA for 271be39 - Browse repository at this point
Copy the full SHA 271be39View commit details -
Related to pygments#1425 Included in this change: * The JSON parser is rewritten * The JSON bare object parser no longer requires additional code * `get_tokens_unprocessed()` returns as much as it can to reduce yields (for example, side-by-side punctuation is not returned separately) * The unit tests were updated * Add unit tests based on Hypothesis test results
Configuration menu - View commit details
-
Copy full SHA for 03eeda6 - Browse repository at this point
Copy the full SHA 03eeda6View commit details -
Reduce HTML formatter memory consumption by ~33% and speed it up
Related to pygments#1425 Tested on a 118MB JSON file. Memory consumption tops out at ~3GB before this patch and drops to only ~2GB with this patch. These were the command lines used: python -m pygments -l json -f html -o .\new-code-classes.html .\jc-output.txt python -m pygments -l json -f html -O "noclasses" -o .\new-code-styles.html .\jc-output.txt
Configuration menu - View commit details
-
Copy full SHA for 3abacaf - Browse repository at this point
Copy the full SHA 3abacafView commit details -
Add an LRU cache to the HTML formatter's HTML-escaping and line-split…
…ting For a 118MB JSON input file, this reduces memory consumption by ~500MB and reduces formatting time by ~15 seconds.
Configuration menu - View commit details
-
Copy full SHA for 69e4882 - Browse repository at this point
Copy the full SHA 69e4882View commit details
Commits on Oct 25, 2020
-
Configuration menu - View commit details
-
Copy full SHA for a219f27 - Browse repository at this point
Copy the full SHA a219f27View commit details
Commits on Oct 26, 2020
-
Configuration menu - View commit details
-
Copy full SHA for 8800a92 - Browse repository at this point
Copy the full SHA 8800a92View commit details -
Configuration menu - View commit details
-
Copy full SHA for e086e48 - Browse repository at this point
Copy the full SHA e086e48View commit details
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.