Currently, we're using the Eclipse IRule system for our HTML parser's lexer. We were doing this for JS and then switched to JFlex to improve performance. I don't recall the exact improvement factor for scanning, but I believe our JS parse became roughly 6x faster with that change. We should consider moving to JFlex for HTML for the same reasons. Also, we're doing multiple passes to parse attributes. We should be able to do this in a single pass. That alone would help parsing speed.