Skip to content
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

Open
wants to merge 18 commits into
base: master
Choose a base branch
from

Commits on Oct 20, 2024

  1. Configuration menu
    Copy the full SHA
    acb2586 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    ca29fa3 View commit details
    Browse the repository at this point in the history
  3. highlighter: gofmt

    JoeKar committed Oct 20, 2024
    Configuration menu
    Copy the full SHA
    ee69f75 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    e98a8a4 View commit details
    Browse the repository at this point in the history
  5. 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!
    JoeKar committed Oct 20, 2024
    Configuration menu
    Copy the full SHA
    9925778 View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    c05d496 View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    95c1fc2 View commit details
    Browse the repository at this point in the history
  8. 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".
    JoeKar committed Oct 20, 2024
    Configuration menu
    Copy the full SHA
    31ac145 View commit details
    Browse the repository at this point in the history
  9. Configuration menu
    Copy the full SHA
    6d922ed View commit details
    Browse the repository at this point in the history
  10. Configuration menu
    Copy the full SHA
    74be831 View commit details
    Browse the repository at this point in the history
  11. highlighter: Small corrections

    JoeKar committed Oct 20, 2024
    Configuration menu
    Copy the full SHA
    92073ca View commit details
    Browse the repository at this point in the history
  12. Configuration menu
    Copy the full SHA
    a4be06d View commit details
    Browse the repository at this point in the history
  13. highlighter: Fix limitGroup behavior of regions

    This 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.
    JoeKar committed Oct 20, 2024
    Configuration menu
    Copy the full SHA
    4c4732b View commit details
    Browse the repository at this point in the history
  14. highlighter: Add capability to remove already captured groups

    This is necessary in the moment sibling regions overlap each other.
    JoeKar committed Oct 20, 2024
    Configuration menu
    Copy the full SHA
    c1f7910 View commit details
    Browse the repository at this point in the history
  15. Configuration menu
    Copy the full SHA
    e5611ee View commit details
    Browse the repository at this point in the history
  16. Configuration menu
    Copy the full SHA
    d6da952 View commit details
    Browse the repository at this point in the history
  17. Configuration menu
    Copy the full SHA
    e9c77fa View commit details
    Browse the repository at this point in the history
  18. highlighter: Properly handle rehighlighting within Highlight()

    Co-authored-by: Dmitry Maluka <[email protected]>
    JoeKar and dmaluka committed Oct 20, 2024
    Configuration menu
    Copy the full SHA
    fb2ed1b View commit details
    Browse the repository at this point in the history