[Wikipedia-l] Optimizing the Wiki parser

Jan Hidders hidders at uia.ua.ac.be
Fri Feb 8 16:19:49 UTC 2002


From: "Uri Yanover" <uriyan_subscribe at yahoo.com>
> 
> Well, while easiness of debugging is important, it 
> is still possible to write a good parser that would 
> be easy to debug;

Ok. If you say so. :-)

> keeping it simple for as long as 
> possible might lead to very hasty and ugly attempts 
> to optimize when it's too late.

You don't know how ugly those attempts
will be until you try (or let somebody else try).

> In addition to that, the internal links check explodes the 
> array which is expensive both in terms of passing again 
> over the text and the added use of memory.

A good point, and indeed something that needs to be
looked at. But you can avoid this also if you use the
regular expressions approach.

> [...] Be the PHP regexp 
> performance as good as it can be, converting from one 
> complicated markup (Wiki) to another (HTML) is 
> simply not the task they were intended for.

When the original Wiki mark-up was designed it was done
so as to be effeciently implementable by Perl regular expressions.

-- Jan Hidders





More information about the Wikipedia-l mailing list