refactor(Noder): optimize line splitting using ReadOnlySpan#34
Merged
Conversation
…ify node extraction
Code CoverageResult: success Show coverage summarySummary
Risk Hotspots
Coverage
|
…into lemon73/improve-noder
…ing with spaces and tabs
Member
Author
|
/gemini summary |
Summary of ChangesThis pull request refactors the Noder component to optimize performance by leveraging ReadOnlySpan for string manipulation. The changes include a shift in how line breaks are interpreted and processed, resulting in more predictable and efficient node generation. While this introduces breaking changes regarding how empty lines and line breaks are handled, it significantly reduces memory overhead and improves processing speed as demonstrated by the provided benchmarks. Highlights
Activity
|
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.
Summary
Improved the processes of Noder.
Details
In Noder processing, replacing operations on
stringandstring[]withReadOnlySpanandList<string>has resulted in faster and more lightweight processing.See also: https://github.com/AliceNovel/CommonNovel/pull/34/changes#diff-51e1cf45389002daed215ce0327155a875852fddba52326385b7afa56daabe09R10-R47
Breaking Changes
Caution
This PR contains breaking changes.
\n(LF) or\r\n(CRLF) →\n(LF)\n(LF) or\r\n(CRLF) →\r\n(CRLF)\n→\n,\r\n→\r\n\n\n\n→[](no elements)\n\n\n→[ "", "" ](two elements)CommonNovel/docs/v0.1.x/v0.1.0.md
Line 51 in 627580e
CommonNovel/docs/v0.1.x/v0.1.0.md
Lines 68 to 79 in 627580e
Benchmark
Before
After