Skip to content

benchmark and performance optimization for selection range #2632

Closed
@kokobd

Description

@kokobd

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 rangeperformanceIssues about memory consumption, responsiveness, etc.type: enhancementNew feature or request

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions