Text_Wiki: a new rendering algorithm
| From: | Justin Patrin | Date: | Sun, 05 Mar 2006 07:11:31 +0000 |
| Subject: | Text_Wiki: a new rendering algorithm | ||
| Groups: | php.pear.dev | ||
| Request: | Send a blank email to pear-dev+get-41660@lists.php.net to get a copy of this message | ||
toggg pointed out a webpage
(http://d.hatena.ne.jp/sumipan/20060304/1141493832) which seems to
point out that Text_Wiki is doing char-by-char iteration in order to
render the tokens in the parsed source. I'd of course seen this
before, but hadn't really thought about it. I implemented a simple
preg_replace_callback solution as well and it seems to be around 20%
faster. I'm not sure about memory usage, however.
I've left in the old code as well. To use the new algorithm set the
newRendering member variable on the object.
If people could test the new algorithm and possibly do some memory and
CPU tests of their own I'd appreciate it.
(Or if anyone has any suggestions for how to profile the code with
free tools I'll try to test it more myself.)
--
Justin Patrin