----------------------------------------
> From: brave...@gmail.com
> Date: Fri, 23 Apr 2010 12:55:03 +0200
> To: itext-questions@lists.sourceforge.net
> Subject: Re: [iText-questions] performance follow up
>
>
> On Apr 22, 2010, at 11:18 PM, trumpetinc wrote:
>>
>> I like your approach! A simple if (ch> 32) return false; at the very top
>> would give the most bang for the least effort (if you do go the bitmask
>> route, be sure to include unit tests!).
>
>
> Doing this change spares approximately two seconds out of the full workload
> so now shows 8s instead of 10s and isWhitespace stays at 1%.
>
> The numbers below include two extra changes: the one from trumpetinc above
> and migrating all StringBuffer references to use instead StringBuilder.
>
> The top are now:
>
> PRTokeniser.nextToken 8% 77s 19'268'000 invocations
> RandomAccessFileOrArray.read 6% 53s 149'047'680 invocations
> MappedRandomAccessFile.read 3% 26s 61'065'680 invocations
> PdfReader.removeUnusedCode 1% 15s 6000 invocations
> PdfEncodings.convertToBytes 1% 15s 5'296'207 invocations
> PRTokeniser.nextValidToken 1% 12s 9'862'000 invocations
> PdfReader.readPRObject 1% 10s 5'974'000 invocations
> ByteBuffer.append(char) 1% 10s 19'379'382 invocations
> PRTokeniser.backOnePosition 1% 10s 17'574'000 invocations
> PRTokeniser.isWhitespace 1% 8s 35'622'000 invocations
>
> A bit further down there is ByteBuffer.append_i that often needs to
> reallocate and do an array copy thus the expensive ByBuffer.append(char)
> above ... I am playing right now with bigger initial sizes e.g. 512 instead
> of 127 ...
I had a draft message I never sent regarding this. Essentially don't
call append, find the end then call String(byte[],offset,length)
or better ( this gets involved ) don't make temp strings just
pass around indexes ( you need to give this some thought, but my
post was getting quite confusing so I scrapped it).
>
> Best regards,
> Giovanni
> ------------------------------------------------------------------------------
> _______________________________________________
> iText-questions mailing list
> iText-questions@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/itext-questions
>
> Buy the iText book: http://www.itextpdf.com/book/
> Check the site with examples before you ask questions:
> http://www.1t3xt.info/examples/
> You can also search the keywords list: http://1t3xt.info/tutorials/keywords/
>
_________________________________________________________________
The New Busy is not the too busy. Combine all your e-mail accounts with Hotmail.
http://www.windowslive.com/campaign/thenewbusy?tile=multiaccount&ocid=PID28326::T:WLMTAGL:ON:WL:en-US:WM_HMP:042010_4
------------------------------------------------------------------------------
_______________________________________________
iText-questions mailing list
iText-questions@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/itext-questions
Buy the iText book: http://www.itextpdf.com/book/
Check the site with examples before you ask questions:
http://www.1t3xt.info/examples/
You can also search the keywords list: http://1t3xt.info/tutorials/keywords/