This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 225021 - Long time spent in the LuceneIndex._store() by method removing the used data.
Summary: Long time spent in the LuceneIndex._store() by method removing the used data.
Status: VERIFIED FIXED
Alias: None
Product: editor
Classification: Unclassified
Component: Parsing & Indexing (show other bugs)
Version: 7.3
Hardware: All All
: P2 normal (vote)
Assignee: Tomas Zezula
URL:
Keywords: PERFORMANCE
Depends on:
Blocks: 223776
  Show dependency tree
 
Reported: 2013-01-17 11:47 UTC by Tomas Zezula
Modified: 2013-01-25 10:36 UTC (History)
2 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Tomas Zezula 2013-01-17 11:47:38 UTC
Long time spent in the LuceneIndex._store() by method removing the used data.
The problem is when an instance of o long ArrayList is sent toto the _store(), the store removes the already stored object by Iterator.remove() to save a heap. Unfortunately the AL.It.remove() delegates to AL.remove(index) which copies the array, so the complexity is O(n*n). This can be simply fixed by using LinkedList however RAM complexity (number of instances) for LL is O(2*n) compared to O(k+n) of AL. So usage of AL is correct type used, the LI._store() should not do the copying.
Comment 1 Tomas Zezula 2013-01-17 12:48:29 UTC
Fixed jet-main: 467a8519ac68
For 1_000_000 items added to index, the remove time decreases from 255_469ms to 72ms.
Comment 2 Dusan Balek 2013-01-17 13:51:25 UTC
The fix seems to be OK.
Comment 3 Quality Engineering 2013-01-18 02:50:54 UTC
Integrated into 'main-golden', will be available in build *201301180001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/467a8519ac68
User: Tomas Zezula <tzezula@netbeans.org>
Log: #225021:Long time spent in the LuceneIndex._store() by method removing the used data.
Comment 4 Tomas Zezula 2013-01-18 10:17:05 UTC
Transplanted int NB 7.3: f3631002e5cf
Comment 5 Quality Engineering 2013-01-19 00:03:35 UTC
Integrated into 'releases', will be available in build *201301182100* or newer. Wait for official and publicly available build.
Changeset: http://hg.netbeans.org/releases/rev/f3631002e5cf
User: Tomas Zezula <tzezula@netbeans.org>
Log: #225021:Long time spent in the LuceneIndex._store() by method removing the used data.
Comment 6 Jiri Prox 2013-01-25 10:36:33 UTC
v.