eclipse-platform / eclipse-platform/eclipse.platform

Slow copy-from-Console with many links inside

Open
#1,503 2 comments 1 reaction 0 assignees View on GitHub
performance
Dominant language
Java
Stars
165
Forks
174
Avg merge
2d 8h
Merged PRs (30d)
22

Description

If the console output contains many lines copying (ctrl+c) the output to clipboard becomes very slow. For example try to copy 100_000 lines already lags some seconds. Seems to be O(n^2) where n is number of lines.
Example to reproduce a long console output :
```
public class Main {
public static void main(String[] args) {
for (int i = 0; i < 100_000; i++) {
System.out.println("org.eclipse.ui.console.TextConsoleViewer.findPosition(TextConsoleViewer.java:497)");
}
}
}
```

Almost all time is spend in org.eclipse.ui.console.TextConsoleViewer.findPosition(int, int, Position[])
![image](https://github.com/user-attachments/assets/743221a0-9474-4241-89d4-0c43b87d1c82)
The copied text is ~8MB:
![image](https://github.com/user-attachments/assets/f3d9ff94-ddc4-415a-bca1-70c811f5dc04)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.