Excuse any tone of this message (curt,etc) -- its a long answer and I'm in a
hurry.

Give me a "uname -a"

The percentage doesn't trouble me as much as the actual time.

1. Are you using a 2.4 kernel with a VM that expects the new 2.6 thread
library (dunno about IBM but newer versions of Jrockit expects a 2.6 thread
library and gets VERRRRRY slow otherwise)

2. Are you using some funky redhat backport of the 2.6 thread library to
2.4?  (Red Hat now officially sucks, ditch them, I live in Durham, NC. I
recommend Gentoo if you don't need commercial support and are a reasonably
strong linux guy and Suse if you do/aren't -- I'm gentoo.... Oh use a 2.6
kernel with a VM that takes advantage).

3. What is the processor speed of this machine (I may assume to much by the
i686)?

4. Are running in swap space? (like a 128 mb machine with a JVM taking a
128mb heap...the JVM will loose to the OS)

I suppose the stack unraveling could be bad...thats some funky workaround
someone applied in there.  The problem is that we don't support "rich
strings" (like "ab" where a is red and b is blue causes excel to make a
"rich string") which means that when we normalize the string to a regular
string, it can be a duplicate ("{special color code}a{special color code}b"
becomes "ab" and thus would conflict with "ab").

What's really funky about that logic is that its probably slower on average
to unravel the stack with an exception than to traverse the tree every time.
What's worst case BinaryTree? -- O(n)?  I forget, but ultimately someone
should fix this short term by getting rid of the try/catch and long term by
adding rich strings (I only do these things in support of paying clients
these days because I'm so busy).  And also, your JVM shouldn't be this slow
(its no where near that slow on my Linux box or OS X laptop and they are all
old).

I suggest:

Create a normal spread sheet and put the same number of plain black strings
in a spreadsheet.  See what the times are of that.  If its nearly as bad
then upload that and your code, I want to see it (via bugzilla and email me
the number).  If its not, then submit a patch that removes this exception.

-Andy
-- 
Andrew C. Oliver
http://www.superlinksoftware.com/poi.jsp
Custom enhancements and Commercial Implementation for Jakarta POI

http://jakarta.apache.org/poi
For Java and Excel, Got POI?


> From: Ian Jackson <[EMAIL PROTECTED]>
> Reply-To: "POI Users List" <[EMAIL PROTECTED]>
> Date: Thu, 11 Nov 2004 09:41:48 -0500
> To: POI Users List <[EMAIL PROTECTED]>
> Subject: Re: Performance and Memory Usage with the Event Model of HSSF
> 
> [EMAIL PROTECTED] wrote:
> 
>> That is bizarrely bad performance.  What VM/architecture is this?
>> 
>> -Andy
>>  
>> 
> uname -m -i -o
> i686 i386 GNU/Linux
> 
> /local/java//j2sdk1.4/bin/java -version
> java version "1.4.2"
> Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2)
> Classic VM (build 1.4.2, J2RE 1.4.2 IBM build cxia321420-20040626 (JIT
> enabled: jitc))
> 
> I created a file of comma seperated values and used open office to write
> an excel file.
> 
> I found in smaller data sets with java hprof that over 30% of the time
> was spent in SSTderializer.addToStringTable and what it called mostly
> creating the exception in put. Nothing else was over 5%. The precentage
> of time in addToStringTable increased as my data set got larger.
>   static public void addToStringTable( BinaryTree strings, Integer
> integer, UnicodeString string )
>   {
> 
>       if ( string.isRichText() )
>           string.setOptionFlags( (byte) ( string.getOptionFlags() & (
> ~8 ) ) );
>       if ( string.isExtendedText() )
>           string.setOptionFlags( (byte) ( string.getOptionFlags() & (
> ~4 ) ) );
> 
>       boolean added = false;
>       while ( added == false )
>       {
>           try
>           {
>               strings.put( integer, string );
>               added = true;
>           }
>           catch ( Exception ignore )
>           {
>               string.setString( string.getString() + " " );
>           }
>       }
> 
>   }
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to