On Wed, May 07, 2003 at 04:48:03PM -0500, Lee Daniel Crocker wrote:
So on a typical page of, say, 40-50 lines, that makes half a millisecond spent in parsing. If PHP were 100 times worse, it would account for 1/20th of a second per page fetch. Doesn't sound like much of a problem to me, and I doubt it's 1000 times worse.
Just curious: what does your parser do with Quotes.txt from the test suite?
Well, I suspect it is about 100 times (or more slower). I don't understand the architecture of the parser perfectly, but a similiar project using a lexical parser (as opposed to progressive pattern matches) was about 200 time slower. At the very least, it'll make the PHP code considerably cleaner.
As far as Quotes.txt goes, ignoring the <p>s, we get:
Wikipedia quoting tests: (1) normal <strong>bold</strong> normal (2) normal <em>italic</em> normal (3) normal <strong><em>bold italic</em></strong> normal (4) normal <strong>bold <em>bold italic</em> bold</strong> normal (5) normal <em>italic <strong>bold italic</strong> italic</em> normal (6) normal <strong><em>bold italic<em> bold<strong> normal (7) normal </em></strong>bold italic</strong> italic</em> normal (8) normal <em>italic <strong>bold italic<strong><em> normal (9) normal </strong>bold </em>bold italic</em></strong> normal (10) normal <strong>bold's</strong> normal (11) normal <em>italic's</em> normal (12) normal <em>italic's <strong>bold's italic</strong> italic's</em> normal (13) normal <strong><em>bold's italic<em> bold's<strong> normal (14) normal </em>italic</strong> normal (15) normal <strong>'bold</strong> normal (16) normal <em>italic</em> normal <em>italic</em> normal (17) normal <em>italic</em> normal <strong>bold</strong> normal (18) normal <strong>bold</strong> normal <strong>bold</strong> normal (19) normal <strong>bold</strong> normal <em>italic</em> normal