feat: performance improvements#63
Draft
Princesseuh wants to merge 9 commits into
Draft
Conversation
Merging this PR will improve performance by 16.4%
|
| Benchmark | BASE |
HEAD |
Efficiency | |
|---|---|---|---|---|
| ⚡ | no plugins |
2.2 ms | 1.7 ms | +28.64% |
| ⚡ | MDAST + HAST plugins |
2.9 ms | 2.4 ms | +22.22% |
| ⚡ | noop HAST plugin |
3.3 ms | 2.8 ms | +17.37% |
| ⚡ | MDAST + HAST plugins |
2.4 ms | 2.1 ms | +15.68% |
| ⚡ | HAST replaceNode keep-children (links) |
5.1 ms | 4.5 ms | +14.3% |
| ⚡ | mutating HAST plugin (set id on headings) |
2.2 ms | 1.9 ms | +13.87% |
| ⚡ | no plugins |
1.6 ms | 1.4 ms | +13.33% |
| ⚡ | MDAST replaceNode keep-children (links) |
2.6 ms | 2.4 ms | +12.21% |
| ⚡ | noop HAST plugin (all elements) |
3.1 ms | 2.8 ms | +10.98% |
| 🆕 | hast-text-noop (visit text nodes, no return) |
N/A | 2.8 ms | N/A |
| 🆕 | hast-elements-only (setProperty per element) |
N/A | 3.7 ms | N/A |
| 🆕 | hast-text-only (text replace per text node) |
N/A | 3.7 ms | N/A |
| 🆕 | mdast-text-only (text replace per text node) |
N/A | 3.5 ms | N/A |
| 🆕 | mdast-text-noop (visit text nodes, no return) |
N/A | 2.4 ms | N/A |
| 🆕 | mutating MDAST plugin (set depth on headings) |
N/A | 1.9 ms | N/A |
| 🆕 | parse_no_positions |
N/A | 721.8 µs | N/A |
Tip
Curious why this is faster? Comment @codspeedbot explain why this is faster on this PR, or directly use the CodSpeed MCP with your agent.
Comparing feat/restore-perf (95325a5) with main (44e3082)
Footnotes
-
10 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports. ↩
Merged
cd27252 to
36502ed
Compare
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Various experiments we did during dev but ended up dropping while we chased conformance, needs a lot of cleaning up, though.