Bug 576601 - [performance] wake up sleeping indexer when needed
Summary: [performance] wake up sleeping indexer when needed
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 4.22   Edit
Hardware: All All
: P3 enhancement (vote)
Target Milestone: 4.22 M2   Edit
Assignee: Jörg Kubitz CLA
QA Contact:
URL:
Whiteboard:
Keywords: greatfix, noteworthy, performance
Depends on:
Blocks:
 
Reported: 2021-10-13 06:41 EDT by Jörg Kubitz CLA
Modified: 2021-11-11 08:05 EST (History)
4 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jörg Kubitz CLA 2021-10-13 06:41:26 EDT
For example JavaSearchBugs9Tests spends most of its time in JobManager's sleep(500).

Patch performance can be testet with JavaSearchBugs9Tests. From 185sec down to 30sec on my computer.
Comment 1 Eclipse Genie CLA 2021-10-13 06:45:43 EDT
New Gerrit change created: https://git.eclipse.org/r/c/jdt/eclipse.jdt.core/+/186430
Comment 3 Michael Keppler CLA 2021-10-15 02:48:25 EDT
Can you comment on how and why you found the bug and/or it's root cause? Were you "just lucky" to run that test locally or did you have some kind of systematic approach to investigate the job queue, the thread state etc.? Asking because I always like to learn how to apply similar approaches to own investigations.
Comment 4 Jörg Kubitz CLA 2021-10-15 03:15:27 EDT
(In reply to Michael Keppler from comment #3)
> Can you comment on how and why you found the bug and/or it's root cause?

I was working on fixing java search. So i created a junit. The junit took too long for my feeling (0.5 seconds seemed to be unreasonable, and i do take of even small overhead). So i started a bigger testsuite (to get more samples) and sampled with ViusalVM. There i typically look for hotspots and improve them. In this case there was no hotspot. The "Total Time" spend in main thread was even larger then the total amount of "Self Time" in the hotspots. So i sorted hotspots by "Total Time" descending. Beside the waits in some meaningless threads there was a sleep that almost fitted the missing difference -> found.

Note that ViusalVM's default settings of sampling typically does not find issues in "java.**". Therefore i changed it to "Do not profile classes:"= "javax.**, jdk.**, com.sun.**, sun.management.**, sunw.**, sun.rmi.**, apple.laf.**, apple.awt.**, com.apple.**, org.omg.CORBA.**, org.omg.CosNaming.**, COM.rsa.**"

I already found a very similar issue, but do not know how to solve it with reasonable effort yet: bug 575864.
Comment 5 Manoj N Palat CLA 2021-10-20 06:41:50 EDT
(In reply to Jörg Kubitz from comment #0)
> Patch performance can be testet with JavaSearchBugs9Tests. From 185sec down
> to 30sec on my computer.

Indeed a noteworthy and great fix; Thank you Jörg!
Comment 6 Lars Vogel CLA 2021-10-21 10:16:29 EDT
Thanks Jörg, today a client migrated from 2021-06 to 2021-12 and his build time was significant reduced, from around 3 mins to ~1 min and I assume at least some it, if not most, was based on your patches.

Thanks for making Eclipse and JDT faster, the client was very positively surprised.
Comment 7 Manoj N Palat CLA 2021-11-11 08:05:09 EST
Verified for Eclipse Version: 2021-12 (4.22) M3 with Build id: I20211110-1800
[by code reading]