apache / apache/netbeans

Very slow work of "Mercurial > Show Annotations" functionality

Open
#4,264 0 comments 0 reactions 0 assignees View on GitHub
kind:bug mercurial needs:triage
Dominant language
Java
Stars
3.1k
Forks
935
Avg merge
2d 3h
Merged PRs (30d)
17

Description

### Apache NetBeans version

Apache NetBeans 14

### What happened

I have project that uses Mercurial (hg) as revision control system.

If I'm trying to use Show Annotations functionality this causes extremely high usage of memory and extra loading to the processor. The action usually takes 3 and more minutes. At the same time if I use original Mercurial command (hg annotate -n -u some-file.php) for this I just get result immediately.

This is CPU, memory levels and time before clicking the menu:
2022-06-21_232402

Then I click the menu and CPU and memory levels starting to grow:
2022-06-21_233135

Finally it uses whole available memory, CPU level is high:
2022-06-21_233314

2022-06-21_233511

Then memory usage goes down, but CPU level is still high:
2022-06-21_233707

Then finally after 5 minutes the CPU level goes down and I can see annotations:
2022-06-21_233809

### How to reproduce

- you need to have hg repository. I have more than 10k files and more than 10k commits.
- create project from this repository and open it
- open some file
- right click on the tab > Mercurial > Show Annotations

2022-06-21_223940

### Did this work correctly in an earlier version?

Apache NetBeans 12.3 or earlier

### Operating System

Windows 10 Home, 21H2, x64

### JDK

jdk-16.0.2

### Apache NetBeans packaging

Apache NetBeans provided installer

### Anything else

The problem occurs every time when I try to get annotations. If I committed some changes to the repo, or pulled and updated and I had some file opened with annotations - the NetBeans starts to "recalculate" those annotations for all those files.

This functionality worked perfectly on NetBeans 8.0.2. Then I changed computer and installed NetBeans 12.4 and it never worked anymore.

For NetBeans 12.4:
-Once I noticed this error message in the logs, but I'm not 100% sure that this is related:
WARNING [org.netbeans.modules.mercurial]: AnnotateAction: toAnnotateLines(): Failed when matching: *** failed to import extension paper: No module named paper
-Also sometimes (very seldom case) if memory of my computer is full and I'm trying to get annotations NetBeans starts to eat memory, but then some overflow happens, I see some error message and annotations on the place. This takes twice less time to get annotations in this case that usual.

### Are you willing to submit a pull request?

No

### Code of Conduct

Yes

Contributor guide

Open the contributing guide

Research direction

Start by reproducing Mercurial > Show Annotations with a large repository, comparing its behavior with the direct hg annotate command and reviewing the reported Mercurial log warning. Trace the annotation workflow and profile CPU and memory use; done means annotations appear without excessive resource consumption or multi-minute delays.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
devtools
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.