-
-
Notifications
You must be signed in to change notification settings - Fork 399
Closed
Labels
component: hls-code-range-pluginfor code range related functionalities, such as selection range and folding rangefor code range related functionalities, such as selection range and folding rangeperformanceIssues about memory consumption, responsiveness, etc.Issues about memory consumption, responsiveness, etc.type: enhancementNew feature or requestNew feature or request
Description
Is your feature request related to a problem? Please describe.
According to discussions in #2565, the current implementation doesn't have an optimal complexity. It is O(n) now, but could be done in O(log(n)). We may add a benchmark to check what will happen when requesting selection ranges in a very large file.
Describe the solution you'd like
- Add a benchmark (currently there is no benchmark for plugins, so this might become the first one).
- Implement a better algorithm (see comments in
findSelectionRangesByPositions
)
Describe alternatives you've considered
Maybe we don't need to optimize, as it works very fast for files with 1000 lines, and large files are rare in practice (why not split them into smaller modules?).
Additional context
The orignal feature request is #212
Metadata
Metadata
Assignees
Labels
component: hls-code-range-pluginfor code range related functionalities, such as selection range and folding rangefor code range related functionalities, such as selection range and folding rangeperformanceIssues about memory consumption, responsiveness, etc.Issues about memory consumption, responsiveness, etc.type: enhancementNew feature or requestNew feature or request