1 Million Rows In A JTable - Or How To Convince C++ Developers

Sometimes it is necessary to perform more dramatic steps to convince C++ developers about Java performance. We developed a JTable with custom model, renderers and editors to port an existing C++ application. We begun with tests, as some of the C++ developers expressed his concerns about the performance and resource usage of the current solution. The old C++ application was able to handle few thousands rows in a table. Instead of discussing the performance of Java we started a spike with 5000 rows in a three row table. The last column consisted of a JComboBox with own model pointing to another 5000 records. It took less than one second to load the table. We increased the number to 50.000 records it took few seconds to load the data and open the application. The we only wanted to break the application and increased the data to 1 million records. ...after about 40 seconds and 1GB heap usage the app opened - it was slow but usable. It is really remarkable because we performed the test without any optimizations. The application was built in object oriented way the domain objects were constructed from REST-like (not really RESTFul) data stream, and were wrapped with a custom table model. Custom renderers and editors were responsible for displaying the data. Every table cell was displayed by a renderer which exposed a domain object. So several instances were involved for a single cell.

We repeated the test within Netbeans Profiler and were able to identify some bottlenecks (unfortunately some of them were written by me...:-)).


Cloudy Jakarta EE and MicroProfile: Microservices, Clouds and Beyond Jakarta EE / MicroProfile airhacks workshops at MUC airport, Winter Edition

airhacks.fm the podcast:

Stay in touch: airhacks.news.

Comments:

9 lines of solid text isn't very easy to read! I recommend looking at the layout of your posts, making them narrower and using some paragraph breaks!

Posted by Rob on February 13, 2009 at 07:45 PM CET #

Hi Rob,

real Java developers don't care about formatting :-).

[however - you are right - few <p> would help]

thanks for the hint!,

regards,

adam

Posted by Adam Bien on February 14, 2009 at 02:08 PM CET #

Could post about the optimizations made or what were the bottlenecks found?

Thanks

Posted by Felipe Jaekel on March 03, 2009 at 01:18 PM CET #

Post a Comment:
  • HTML Syntax: NOT allowed
Online Workshops
realworldpatterns.com
...the last 150 posts
...the last 10 comments
License