I'm with the XHTMLRenderer project on java.net, I think you've sent us a Hello in the last few months.
We are using your (very stable and cool) CSS parser to good result. Glad to see you are continuing to develop it.
I just installed the NetBeans Profiler module (for NB 4.0) and ran some web pages through our tool to see the results. A surprising find was that using the CSS parser is taking about 30% of total processing time. This is split roughly between a call to CSSOMParser.parseStyleSheets() (23% cost) and .parseSelectors() (11% cost).
For parseStyleSheets() the cost is almost all in SACParser.styleSheet(), particularly in styleRule(), almost evenly split between declaration() and jj_ntk().
For parseSelectors() the cost is again in SACParser, split evenly between getCharStream() and selectorList().
My general take is that the tokenization is one point of contention, and the second is the init for ASCII_CharStream().
I hope this info is helpful to you in some way. The parser is stable and integrates well with our code. If I can help improving the performance in any way, let me know.
Many thanks
Patrick
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi Dave
I'm with the XHTMLRenderer project on java.net, I think you've sent us a Hello in the last few months.
We are using your (very stable and cool) CSS parser to good result. Glad to see you are continuing to develop it.
I just installed the NetBeans Profiler module (for NB 4.0) and ran some web pages through our tool to see the results. A surprising find was that using the CSS parser is taking about 30% of total processing time. This is split roughly between a call to CSSOMParser.parseStyleSheets() (23% cost) and .parseSelectors() (11% cost).
For parseStyleSheets() the cost is almost all in SACParser.styleSheet(), particularly in styleRule(), almost evenly split between declaration() and jj_ntk().
For parseSelectors() the cost is again in SACParser, split evenly between getCharStream() and selectorList().
My general take is that the tokenization is one point of contention, and the second is the init for ASCII_CharStream().
I hope this info is helpful to you in some way. The parser is stable and integrates well with our code. If I can help improving the performance in any way, let me know.
Many thanks
Patrick
That is very interesting - I shall get a hold of the profiler myself and try to get a closer look at what is happening.
Thanks for bringing this to my attention!
Regards,
David