poi-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Yegor Kozlov <yegor.koz...@dinom.ru>
Subject Re: taking too long to create xlsm
Date Sun, 26 Jun 2011 11:54:58 GMT
It is very likely that you are facing the same problem as described in
this thread:
http://markmail.org/message/3o7o4t7laesacvwl

On low level, POI uses XmlBeans to manipulate the SpreadsheetML
format. Each row is represented by a CTRow bean and the collection of
rows is held by CTSheetData.

When POI saves a worksheet, it ensures that rows are sorted in
ascending order. If rows are not ordered (inserted in random order or
shuffled by shiftRows) then the expensive stuff happens: rows are
detached from the container, sorted and re-attached. If the number or
rows is large it is a damn expensive operation.

Try to optimize your code to write rows in ascending order.

If you think that the problem has different roots, please post an
*isolated* program that demonstrates the performance issue. It should
not rely any jdbc or external libs, just plain Java and POI.

If it requires a template file then attach that file too.

Yegor

On Fri, Jun 17, 2011 at 8:42 AM, dpront <gerard.agda@xmarter.com> wrote:
> Hi Guys,
>
>  I have a simple code that reads and writes xlsm file.  But the problem is,
> the program is taking too long to create the output xlsm file (average time
> is 8minutes).  By the way, I have substituted the
> poi-ooxml-schemas-3.6-20091214.jar into ooxml-schemas-1.1.jar because that
> jar has more class files than the poi-ooxml-schemas-3.6-2009121.jar.
>
>  The input xlsm file got a size of 1.4MB, has 9 worksheets on it and on
> every worksheet has an image of around 1x1 inch.  On every worksheet also,
> there are some column that has drop down box that consists of legal inputs.
>
> My code is here:
> http://pastebin.com/mbXJsHf3
>
> Thanks.
>
> --
> View this message in context: http://apache-poi.1045710.n5.nabble.com/taking-too-long-to-create-xlsm-tp4497635p4497635.html
> Sent from the POI - User mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@poi.apache.org
> For additional commands, e-mail: user-help@poi.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@poi.apache.org
For additional commands, e-mail: user-help@poi.apache.org


Mime
View raw message