-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
highlighter: Change the parsing approach to significantly improve performance #3127
base: master
Are you sure you want to change the base?
Commits on Oct 20, 2024
-
Configuration menu - View commit details
-
Copy full SHA for acb2586 - Browse repository at this point
Copy the full SHA acb2586View commit details -
Configuration menu - View commit details
-
Copy full SHA for ca29fa3 - Browse repository at this point
Copy the full SHA ca29fa3View commit details -
Configuration menu - View commit details
-
Copy full SHA for ee69f75 - Browse repository at this point
Copy the full SHA ee69f75View commit details -
Configuration menu - View commit details
-
Copy full SHA for e98a8a4 - Browse repository at this point
Copy the full SHA e98a8a4View commit details -
highlighter: Combine HighlightStates and HighlightMatches to Highlight
The most expensive path in the highlighting process is the regex parsing step which was invoked for every line twice due to the split approach. Since this can be done in one step the highlighting effort can be reduced by around 50 percent!
Configuration menu - View commit details
-
Copy full SHA for 9925778 - Browse repository at this point
Copy the full SHA 9925778View commit details -
Configuration menu - View commit details
-
Copy full SHA for c05d496 - Browse repository at this point
Copy the full SHA c05d496View commit details -
Configuration menu - View commit details
-
Copy full SHA for 95c1fc2 - Browse repository at this point
Copy the full SHA 95c1fc2View commit details -
highlighter: Rework of matching approach to speed up the processing
The old approach was to slide over the line by (empty) region over region one after another. Step down into a possible available nested part and do the same. The new approach iterates over all available region definitions and shall find all occurrences of the same region at the same time (`findAllIndex()`) and not just the first (`findIndex()`). This will allow marking a region already in the moment it isn't the first region at the line. After an region has been identified all nested parts are considered the same way. Simple example (no nesting): 1. region start=" end=" 2. region start=' end=' 3. region start=< end=> The "first", "second" and "third" are highlighted in one round. This 'highlights after ""' while <highlights last> and "highlights first".
Configuration menu - View commit details
-
Copy full SHA for 31ac145 - Browse repository at this point
Copy the full SHA 31ac145View commit details -
Configuration menu - View commit details
-
Copy full SHA for 6d922ed - Browse repository at this point
Copy the full SHA 6d922edView commit details -
Configuration menu - View commit details
-
Copy full SHA for 74be831 - Browse repository at this point
Copy the full SHA 74be831View commit details -
Configuration menu - View commit details
-
Copy full SHA for 92073ca - Browse repository at this point
Copy the full SHA 92073caView commit details -
Configuration menu - View commit details
-
Copy full SHA for a4be06d - Browse repository at this point
Copy the full SHA a4be06dView commit details -
highlighter: Fix
limitGroup
behavior of regionsThis is just my interpretation of `limitGroup` as it might be intended a long time ago, but this interpretation could be wrong, since it is not really documented how it should be.
Configuration menu - View commit details
-
Copy full SHA for 4c4732b - Browse repository at this point
Copy the full SHA 4c4732bView commit details -
highlighter: Add capability to remove already captured groups
This is necessary in the moment sibling regions overlap each other.
Configuration menu - View commit details
-
Copy full SHA for c1f7910 - Browse repository at this point
Copy the full SHA c1f7910View commit details -
Configuration menu - View commit details
-
Copy full SHA for e5611ee - Browse repository at this point
Copy the full SHA e5611eeView commit details -
Configuration menu - View commit details
-
Copy full SHA for d6da952 - Browse repository at this point
Copy the full SHA d6da952View commit details -
Configuration menu - View commit details
-
Copy full SHA for e9c77fa - Browse repository at this point
Copy the full SHA e9c77faView commit details -
highlighter: Properly handle rehighlighting within
Highlight()
Co-authored-by: Dmitry Maluka <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for fb2ed1b - Browse repository at this point
Copy the full SHA fb2ed1bView commit details