Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

POI performance

Tags:

I am using POI in my J2EE web application to generate a workbook. However, i find that POI takes around 3 mins to create a workbook with 25K rows(with around 15 columns each). Is this a POI performance issue , or is it justified to take that much of time? Are there other APIs known for better performance ?

like image 214
The Machine Avatar asked Mar 23 '10 08:03

The Machine


People also ask

What is the importance of poi?

The Poi was used, many years ago, by the indigenous Māori people of New Zealand to increase their flexibility and strength in their hands and arms as well as improving coordination. Wāhine (female) dancers perform the Māori Poi, a dance performed with balls attached to flax strings, swung rhythmically.

What is poi flow?

Poi is one of the flow arts' simplest and most common forms, where you swing two small weights around on cords. The physical activity feels great and the challenge of the movement engages you so fully that everything else melts away.

What are the different types of poi?

Fire poi has three types of grip: ball, single loop and double loop. The single loop is best for beginners as it can cinch down on your fingers as you swing. LED Pixel poi and glow poi are pixelated LEDs, in which the individual LEDs are programmable.

What is poi spinning?

What is Poi Spinning? Poi spinning is a flow art that involves swinging tethered weights in a variety of rhythms and motions to create geometric patterns of light or color. This unique combination of performance art and dexterity play tends make spinning poi feel like an improvisational dance or meditative flow state.


2 Answers

The performance of writing large files with POI can be heavily reduced if you used the 'streaming' POI API instead of the standard one. Indeed by default POI will keep all your data in memory before writing all in one go at the end. The memory footprint of this can be ridiculously large for big files. Instead using the streaming API you can control how memory is used and data is written to disk progressively.

In order to create a streaming workbook, use something like :

  SXSSFWorkbook book = new SXSSFWorkbook();    book.setCompressTempFiles(true);    SXSSFSheet sheet = (SXSSFSheet) book.createSheet();   sheet.setRandomAccessWindowSize(100);// keep 100 rows in memory, exceeding rows will be flushed to disk   // ... 
like image 88
Eric Nicolas Avatar answered Oct 31 '22 11:10

Eric Nicolas


I would be very surprised to see POI take that much time to generate such a file. I just generated a sheet with 30000 rows x 10 cells in about 18s (no formatting, to be fair). The cause might be one of the following:

  • POI logging might be turned on, as described here
  • you are running from swap memory
  • your VM available heap might be very low
like image 27
Tomislav Nakic-Alfirevic Avatar answered Oct 31 '22 11:10

Tomislav Nakic-Alfirevic