The semantics are different (the JSE call includes more characters in it's
definition of whitespace than the PDF spec).  Not saying that it can't be
easily done, but throwing an if statement at it and seeing what impact it
has on performance is pretty easy also.

What was the overall time %age spent in this call in your tests?


Giovanni Azua-2 wrote:
> 
> Hello,
> 
> On Apr 22, 2010, at 10:59 PM, Giovanni Azua wrote:
>> PRTokeniser.isWhitespace is a simple boolean condition that just happen
>> to be called gazillion times e.g. 35'622'000 times for my test workload
>> ... if instead of doing it like:
>> 
>> public static final boolean isWhitespace(int ch) {
>>     return (ch == 0 || ch == 9 || ch == 10 || ch == 12 || ch == 13 || ch
>> == 32);
>> }     
>> 
>> we used a bitwise binary operator with the appropriate mask(s), there
>> could be some good performance gain ... 
>> 
> The function already exists in
> http://java.sun.com/javase/6/docs/api/java/lang/Character.html#isWhitespace%28char%29
> I checked and it already uses bitwise binary operators with the right
> masks ... we would only need to inline it to avoid the function call
> costs.
> 
> 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/
> 

-- 
View this message in context: 
http://old.nabble.com/performance-follow-up-tp28322800p28334828.html
Sent from the iText - General mailing list archive at Nabble.com.


------------------------------------------------------------------------------
_______________________________________________
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/

Reply via email to