Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 385300 - to many getItems calls bring performance issues
Summary: to many getItems calls bring performance issues
Status: RESOLVED FIXED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: Nebula (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows Server 2003
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Mirko Paturzo CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-07-17 09:03 EDT by Nikolaos Kaintantzis CLA
Modified: 2021-07-05 11:40 EDT (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Nikolaos Kaintantzis CLA 2012-07-17 09:03:55 EDT
Build Identifier: 1-0-0_2010_08_07-698-gf801931

We had performance issues on a grid table with > 200'000 rows

Our findings: getItems() which copies from List to Array is called to many times, even when only the number of items is needed

after replacing:
- all method calls like item.getParentItem().getItems().length
  by item.getParentItem().getItemCount()

- and all getItems()[index] calls
  by getItem(index)

in Grid.java and GridItem.java we improved performance by 75%

Reproducible: Always
Comment 1 Mirko Paturzo CLA 2014-04-17 04:57:27 EDT
Hi all,

I checked out and did some tests. Can I work on it?
Comment 2 Wim Jongman CLA 2014-04-17 15:29:28 EDT
(In reply to Mirko Paturzo from comment #1)
> Hi all,
> 
> I checked out and did some tests. Can I work on it?

Sure! Can you take the bug yourself now?
Comment 3 Mirko Paturzo CLA 2014-04-18 01:59:55 EDT
YEAH!
Comment 4 Wim Jongman CLA 2014-04-20 06:39:04 EDT
Fixed with:

http://git.eclipse.org/c/nebula/org.eclipse.nebula.git/commit/?id=79ae80eaf87cba17dc0e1a742a97fb9c53dbaec9

Gerrit:

https://git.eclipse.org/r/#/c/25254/

Mirko please take the honors of closing this bug.
Comment 5 Mirko Paturzo CLA 2014-04-20 12:24:01 EDT
Hi all,
using the tool jvisualvm, I verified that the method Grid.items.indexOf was very slow. avoiding this method, there was a significant increase in performance.
Happy Easter to all.
Mirko