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/