benchmark and performance optimization for selection range #2632
Labels
component: hls-code-range-plugin
for code range related functionalities, such as selection range and folding range
performance
Issues about memory consumption, responsiveness, etc.
type: enhancement
New feature or request
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
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
The text was updated successfully, but these errors were encountered: