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 163365 Details for
Bug 306170
[perfs] Regression for FullSourceWorkspaceTypeHierarchyTests#testPerfAllTypes()
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
Proposed patch
sizeBaseHash.txt (text/plain), 6.67 KB, created by
Satyam Kandula
on 2010-03-30 02:53:13 EDT
(
hide
)
Description:
Proposed patch
Filename:
MIME Type:
Creator:
Satyam Kandula
Created:
2010-03-30 02:53:13 EDT
Size:
6.67 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 30 Mar 2010 06:19:26 -0000 >@@ -132,7 +132,7 @@ > } > return results; > } >-private HashtableOfObject addQueryResult(HashtableOfObject results, char[] word, CategoryTable wordsToDocNumbers, MemoryIndex memoryIndex) throws IOException { >+private HashtableOfObject addQueryResult(HashtableOfObject results, char[] word, HashtableOfObject wordsToDocNumbers, MemoryIndex memoryIndex) throws IOException { > // must skip over documents which have been added/changed/deleted in the memory index > if (results == null) > results = new HashtableOfObject(13); >@@ -163,7 +163,7 @@ > HashtableOfObject results = null; // initialized if needed > 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 >+ HashtableOfObject wordsToDocNumbers = readCategoryTable(categories[i], true); // cache if key is null since its a definite match > if (wordsToDocNumbers != null) { > char[][] words = wordsToDocNumbers.keyTable; > if (results == null) >@@ -179,14 +179,14 @@ > switch (matchRule) { > 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); >+ HashtableOfObject wordsToDocNumbers = readCategoryTable(categories[i], false); > if (wordsToDocNumbers != null && wordsToDocNumbers.containsKey(key)) > results = addQueryResult(results, key, wordsToDocNumbers, memoryIndex); > } > break; > case SearchPattern.R_PREFIX_MATCH | SearchPattern.R_CASE_SENSITIVE: > for (int i = 0, l = categories.length; i < l; i++) { >- CategoryTable wordsToDocNumbers = readCategoryTable(categories[i], false); >+ HashtableOfObject wordsToDocNumbers = readCategoryTable(categories[i], false); > if (wordsToDocNumbers != null) { > char[][] words = wordsToDocNumbers.keyTable; > for (int j = 0, m = words.length; j < m; j++) { >@@ -199,7 +199,7 @@ > break; > default: > for (int i = 0, l = categories.length; i < l; i++) { >- CategoryTable wordsToDocNumbers = readCategoryTable(categories[i], false); >+ HashtableOfObject wordsToDocNumbers = readCategoryTable(categories[i], false); > if (wordsToDocNumbers != null) { > char[][] words = wordsToDocNumbers.keyTable; > for (int j = 0, m = words.length; j < m; j++) { >@@ -336,9 +336,9 @@ > char[] categoryName = categoryNames[i]; > if (categoryName != null) { > SimpleWordSet wordSet = (SimpleWordSet) wordSets[i]; >- CategoryTable wordsToDocs = (CategoryTable) this.categoryTables.get(categoryName); >+ HashtableOfObject wordsToDocs = (HashtableOfObject) this.categoryTables.get(categoryName); > if (wordsToDocs == null) >- this.categoryTables.put(categoryName, wordsToDocs = new CategoryTable(wordSet.elementSize)); >+ this.categoryTables.put(categoryName, wordsToDocs = new HashtableOfObject(wordSet.elementSize)); > > char[][] words = wordSet.words; > for (int j = 0, m = words.length; j < m; j++) { >@@ -442,11 +442,11 @@ > this.categoryTables = null; > } > private void mergeCategory(char[] categoryName, DiskIndex onDisk, int[] positions, FileOutputStream stream) throws IOException { >- CategoryTable wordsToDocs = (CategoryTable) this.categoryTables.get(categoryName); >+ HashtableOfObject wordsToDocs = (HashtableOfObject) this.categoryTables.get(categoryName); > if (wordsToDocs == null) >- wordsToDocs = new CategoryTable(3); >+ wordsToDocs = new HashtableOfObject(3); > >- CategoryTable oldWordsToDocs = onDisk.readCategoryTable(categoryName, true); >+ HashtableOfObject oldWordsToDocs = onDisk.readCategoryTable(categoryName, true); > if (oldWordsToDocs != null) { > char[][] oldWords = oldWordsToDocs.keyTable; > Object[] oldArrayOffsets = oldWordsToDocs.valueTable; >@@ -580,7 +580,7 @@ > this.streamBuffer = null; > } > } >-private synchronized CategoryTable readCategoryTable(char[] categoryName, boolean readDocNumbers) throws IOException { >+private synchronized HashtableOfObject readCategoryTable(char[] categoryName, boolean readDocNumbers) throws IOException { > // result will be null if categoryName is unknown > int offset = this.categoryOffsets.get(categoryName); > if (offset == HashtableOfIntValues.NO_VALUE) { >@@ -590,7 +590,7 @@ > if (this.categoryTables == null) { > this.categoryTables = new HashtableOfObject(3); > } else { >- CategoryTable cachedTable = (CategoryTable) this.categoryTables.get(categoryName); >+ HashtableOfObject cachedTable = (HashtableOfObject) this.categoryTables.get(categoryName); > if (cachedTable != null) { > if (readDocNumbers) { // must cache remaining document number arrays > Object[] arrayOffsets = cachedTable.valueTable; >@@ -603,7 +603,7 @@ > } > > FileInputStream stream = new FileInputStream(this.indexFile); >- CategoryTable categoryTable = null; >+ HashtableOfObject categoryTable = null; > char[][] matchingWords = null; > int count = 0; > int firstOffset = -1; >@@ -621,7 +621,11 @@ > System.err.println("size = "+size); //$NON-NLS-1$ > System.err.println("-------------------- END --------------------"); //$NON-NLS-1$ > } >- categoryTable = new CategoryTable(size); >+ if (size > 1024) { >+ categoryTable = new CategoryTable(size); >+ } else { >+ categoryTable = new HashtableOfObject(size); >+ } > } catch (OutOfMemoryError oom) { > // DEBUG > oom.printStackTrace(); >@@ -1030,10 +1034,10 @@ > Object[] tables = this.categoryTables.valueTable; > for (int i = 0, l = categoryNames.length; i < l; i++) > if (categoryNames[i] != null) >- writeCategoryTable(categoryNames[i], (CategoryTable) tables[i], stream); >+ writeCategoryTable(categoryNames[i], (HashtableOfObject) tables[i], stream); > this.categoryTables = null; > } >-private void writeCategoryTable(char[] categoryName, CategoryTable wordsToDocs, FileOutputStream stream) throws IOException { >+private void writeCategoryTable(char[] categoryName, HashtableOfObject wordsToDocs, FileOutputStream stream) throws IOException { > // the format of a category table is as follows: > // any document number arrays with >= 256 elements are written before the table (the offset to each array is remembered) > // then the number of word->int[] pairs in the table is written
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 306170
:
163365
|
167267
|
167490