A quick test run on performance.
All functions used are part of the core php distribution, thats probably the reason I can’t profile this script, other then looking at the total processing time :-(
(no profiling output generated..)
Anyway, I inserted the TP3.2 template (which is a rather large template code wise), which is of course for the strpos and friends functions not so nice.
Even with 21 snippets, the total time was just 0.010 seconds on my server (amd k6 400), so I don’t think performance is an issue here

(or in other words, no chance to improve the situation anyhow)
Of course, if I could compare it with the current logic.....
Remon
(if you don’t mind a little messy output, the parser output _does_ look nice:
http://vt.shuis.tudelft.nl/~remon/test/pseudo.php
)