Bug 500728 - Saving can get quite slow
Summary: Saving can get quite slow
Status: NEW
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 4.6   Edit
Hardware: PC Windows NT
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: JDT-Core-Inbox CLA
QA Contact: Manoj N Palat CLA
URL:
Whiteboard: stalebug
Keywords:
Depends on:
Blocks:
 
Reported: 2016-09-02 06:09 EDT by Lukas Eder CLA
Modified: 2022-12-16 15:31 EST (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Lukas Eder CLA 2016-09-02 06:09:28 EDT
I've made the experience that Eclipse can get quite slow on the organise imports save action when saving some files. I've run a profiling session with JMC and this is the single hot method:

Stack Trace	Sample Count	Percentage(%)
org.eclipse.jdt.core.compiler.CharOperation.hashCode(char[])	477	35.624
   org.eclipse.jdt.internal.compiler.util.HashtableOfObject.putUnsafely(char[], Object)	477	35.624
      org.eclipse.jdt.internal.core.index.DiskIndex.mergeCategory(char[], DiskIndex, int[], FileOutputStream)	477	35.624
         org.eclipse.jdt.internal.core.index.DiskIndex.mergeCategories(DiskIndex, int[], FileOutputStream)	477	35.624
            org.eclipse.jdt.internal.core.index.DiskIndex.mergeWith(MemoryIndex)	477	35.624
               org.eclipse.jdt.internal.core.index.Index.save()	477	35.624
                  org.eclipse.jdt.internal.core.search.indexing.IndexManager.saveIndex(Index)	477	35.624
                     org.eclipse.jdt.internal.core.search.indexing.IndexManager.saveIndexes()	477	35.624
                        org.eclipse.jdt.internal.core.search.indexing.IndexManager.notifyIdle(long)	477	35.624
                           org.eclipse.jdt.internal.core.search.processing.JobManager.run()	477	35.624
                              java.lang.Thread.run()	477	35.624


This is the call tree leading to the hot method, and other related methods:

Stack Trace	Sample Count	Percentage(%)
java.lang.Thread.run()	819	61.165
   org.eclipse.jdt.internal.core.search.processing.JobManager.run()	814	60.792
      org.eclipse.jdt.internal.core.search.indexing.IndexManager.notifyIdle(long)	731	54.593
         org.eclipse.jdt.internal.core.search.indexing.IndexManager.saveIndexes()	731	54.593
            org.eclipse.jdt.internal.core.search.indexing.IndexManager.saveIndex(Index)	731	54.593
               org.eclipse.jdt.internal.core.index.Index.save()	731	54.593
                  org.eclipse.jdt.internal.core.index.DiskIndex.mergeWith(MemoryIndex)	731	54.593
                     org.eclipse.jdt.internal.core.index.DiskIndex.mergeCategories(DiskIndex, int[], FileOutputStream)	730	54.518
                        org.eclipse.jdt.internal.core.index.DiskIndex.mergeCategory(char[], DiskIndex, int[], FileOutputStream)	730	54.518
                           org.eclipse.jdt.internal.compiler.util.HashtableOfObject.putUnsafely(char[], Object)	593	44.287
                              org.eclipse.jdt.core.compiler.CharOperation.hashCode(char[])	477	35.624
                              org.eclipse.jdt.internal.compiler.util.HashtableOfObject.rehash()	48	3.585
                           org.eclipse.jdt.internal.core.index.DiskIndex.readCategoryTable(char[], boolean)	57	4.257
                           org.eclipse.jdt.internal.compiler.util.HashtableOfObject.get(char[])	53	3.958
                           org.eclipse.jdt.internal.core.index.DiskIndex$IntList.add(int)	24	1.792
                           org.eclipse.jdt.internal.core.index.DiskIndex.writeCategoryTable(char[], HashtableOfObject, FileOutputStream)	3	0.224


Most time is spent inside of DiskIndex.mergeCategory()

I'm very happy to provide additional information that might be needed to track down the problem. I didn't want to add too much information that won't help solve the issue.
Comment 1 Eclipse Genie CLA 2020-08-20 14:50:09 EDT
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet.

If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.

--
The automated Eclipse Genie.
Comment 2 Eclipse Genie CLA 2022-12-16 15:31:36 EST
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet.

If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.

--
The automated Eclipse Genie.