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!).
I know there were a lot of calls to this method, but I'm curious: in your pofiling, how much of the total processing _time_ was spent in that routine? The if() would make this 6 times faster, but it's hard to believe that this call has any appreciable contribution to runtime. Keep it up! - K Giovanni Azua-2 wrote: > > > Now only 23.8% to go. We only need to make 4 more fixes like the last one > and the gap will be gone :) The Profiler shows there are still several > bottlenecks topping which could also be easy fixes e.g. > 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 ... > > 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-tp28322800p28334733.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/