Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 164936 Details for
Bug 305116
[index] Improve performance of indexes results tables
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
Proposed patch
patch.txt (text/plain), 3.77 KB, created by
Satyam Kandula
on 2010-04-15 02:38:33 EDT
(
hide
)
Description:
Proposed patch
Filename:
MIME Type:
Creator:
Satyam Kandula
Created:
2010-04-15 02:38:33 EDT
Size:
3.77 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.jdt.core >Index: search/org/eclipse/jdt/internal/core/index/DiskIndex.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/index/DiskIndex.java,v >retrieving revision 1.69 >diff -u -r1.69 DiskIndex.java >--- search/org/eclipse/jdt/internal/core/index/DiskIndex.java 9 Mar 2010 05:55:04 -0000 1.69 >+++ search/org/eclipse/jdt/internal/core/index/DiskIndex.java 15 Apr 2010 06:29:02 -0000 >@@ -132,11 +132,13 @@ > } > return results; > } >-private HashtableOfObject addQueryResult(HashtableOfObject results, char[] word, CategoryTable wordsToDocNumbers, MemoryIndex memoryIndex) throws IOException { >+private HashtableOfObject addQueryResult(HashtableOfObject results, char[] word, CategoryTable wordsToDocNumbers, MemoryIndex memoryIndex, boolean checkBeforeAdd) throws IOException { > // must skip over documents which have been added/changed/deleted in the memory index > if (results == null) > results = new HashtableOfObject(13); >- EntryResult result = (EntryResult) results.get(word); >+ EntryResult result = null; >+ if (checkBeforeAdd) >+ result = (EntryResult) results.get(word); > if (memoryIndex == null) { > if (result == null) > results.putUnsafely(word, new EntryResult(word, wordsToDocNumbers)); >@@ -161,6 +163,7 @@ > if (this.categoryOffsets == null) return null; // file is empty > > HashtableOfObject results = null; // initialized if needed >+ boolean checkBeforeAdd = memoryIndex != null; // used to optimize adding the results > if (key == null) { > for (int i = 0, l = categories.length; i < l; i++) { > CategoryTable wordsToDocNumbers = readCategoryTable(categories[i], true); // cache if key is null since its a definite match >@@ -170,7 +173,8 @@ > results = new HashtableOfObject(wordsToDocNumbers.elementSize); > for (int j = 0, m = words.length; j < m; j++) > if (words[j] != null) >- results = addQueryResult(results, words[j], wordsToDocNumbers, memoryIndex); >+ results = addQueryResult(results, words[j], wordsToDocNumbers, memoryIndex, checkBeforeAdd); >+ checkBeforeAdd = true; > } > } > if (results != null && this.cachedChunks == null) >@@ -180,8 +184,10 @@ > case SearchPattern.R_EXACT_MATCH | SearchPattern.R_CASE_SENSITIVE: > for (int i = 0, l = categories.length; i < l; i++) { > CategoryTable wordsToDocNumbers = readCategoryTable(categories[i], false); >- if (wordsToDocNumbers != null && wordsToDocNumbers.containsKey(key)) >- results = addQueryResult(results, key, wordsToDocNumbers, memoryIndex); >+ if (wordsToDocNumbers != null && wordsToDocNumbers.containsKey(key)) { >+ results = addQueryResult(results, key, wordsToDocNumbers, memoryIndex, checkBeforeAdd); >+ checkBeforeAdd = true; >+ } > } > break; > case SearchPattern.R_PREFIX_MATCH | SearchPattern.R_CASE_SENSITIVE: >@@ -192,8 +198,9 @@ > for (int j = 0, m = words.length; j < m; j++) { > char[] word = words[j]; > if (word != null && key[0] == word[0] && CharOperation.prefixEquals(key, word)) >- results = addQueryResult(results, word, wordsToDocNumbers, memoryIndex); >+ results = addQueryResult(results, word, wordsToDocNumbers, memoryIndex, checkBeforeAdd); > } >+ checkBeforeAdd = true; > } > } > break; >@@ -205,8 +212,9 @@ > for (int j = 0, m = words.length; j < m; j++) { > char[] word = words[j]; > if (word != null && Index.isMatch(key, word, matchRule)) >- results = addQueryResult(results, word, wordsToDocNumbers, memoryIndex); >+ results = addQueryResult(results, word, wordsToDocNumbers, memoryIndex, checkBeforeAdd); > } >+ checkBeforeAdd = true; > } > } > }
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 305116
:
164936
|
165230
|
165368