I have been using Hibernate for a very long time, and I'm more or less satisfied with it. When I saw that Google App Engine uses the JPA/JDO implementation of Datanucleus for high level persistence, I decided to create a sample JPA project with it.
Showing posts with label java. Show all posts
Showing posts with label java. Show all posts
2010/01/11
Incremental average calculation
To calculate the average of some numbers, we can use the following simple formula:

2009/12/23
Adding many items to a GWT ListBox - a faster approach
Adding items to a ListBox using the ListBox.addItem() method may result in performance problems on some browsers, which has been reported as issue#49.
For example, adding 10000 items in a loop takes (on my computer):
The performance of IE8 is not acceptable, it's just too slow.
Fortunatelly there is a much faster method if you need to add many items when the ListBox is created (or it is possible to recreate the ListBox when it has to be repopulated).
For example, adding 10000 items in a loop takes (on my computer):
| Browser | Time |
|---|---|
| FireFox 3.5.6 | 205 ms |
| Google Chrome 3.0.195.38 | 58 ms |
| Internet Explorer 8.0.6001.18702 | 33375 ms |
The performance of IE8 is not acceptable, it's just too slow.
Fortunatelly there is a much faster method if you need to add many items when the ListBox is created (or it is possible to recreate the ListBox when it has to be repopulated).
Subscribe to:
Posts (Atom)