Ehm, included files indeed depend on disk IO, but fortunately, Linux handles this very nicely.
When a file is frequently requested from hard disk, it keeps it buffered in memory, so no need to worry about that.
I agree that having lots of includes doesn’t make sense either.
Having a number of well thought out classes could do the trick.
For example, if a page is cached, and no snippets needs evaluating, there is no need to load all kind of API’s which could be accesed from within snippets.
If a page is cached but there is need to process snippets, load the processTags object.
Everything related to processing Tags (and thus snippets an API calls) can be put into that objects class.
If a page is not cached, load the createDocument object, which has an instance of processTags and so on
Anyway, I tried to strip down the parser to the bare minimum, not sure if it can be made even smaller, but it’s now about 800 lines of code.
Note that it only is able to serve cached pages in this form.
But the numbers speak for themselfs: (PIII 800)
Before: 35 req/sec (Code size ~2500 lines)
After : 46 req/sec (Code size ~800 lines)
(With invokeEvent commented out and ~800 lines of code: 57 req/sec)
The Plugin events etc do add some code and degradation of performance, but someone is working on that?
But as you see, for cached pages, the code size significantly adds to the overhead.
Remon
EDIT:
The results aren’t consistent on multiple runs, but I’m testing on my own machine now, so... At least, it’s faster with smaller parser ;-) )
EDIT 2:
Attached stripped down parser class