Thinking About Speed
by
on 01-15-2010 at 03:40 PM (450 Views)
I've updated the demo site to v.1.0.2 (coming soon to the SVN trunk), but it's feeling really sluggish compared to these forums. I'm just not sure why.
Hotaru uses caching quite extensively, especially from the second page view. Here are the stats from the home page of the demo site:
But it feels more like 6 seconds. Two processes which you would expect to strain the server are (1) checking plugin hooks, and (2) finding and merging all the CSS and JavaScript files from plugins. But...52 database queries and a page load time of 1.8 seconds. This page used 6.9 MB bytes of memory. [Hotaru CMS v.1.0.2]
1) When a plugin is installed, the hooks it uses are saved in the database's pluginhooks table. The pluginHook function queries this table and caches the results for 12 hours, unless a new plugin is installed. So using the cached results should be lightning fast.
2) Hotaru uses PHP's file_exists function to find the CSS and JavaScript files and check their last modified dates. If a file has been modified, all the files are merged into one and archived as a single file which is used until anothermerger is necessary. Apparently, file system access is faster than using a database, so this should be pretty quick, too...
Hmm....
Hold on! How about this:
Even though we know which plugin functions to call at each pluginHook, Hotaru still has to create a new object for every plugin function called. Come to think of it, even the main Hotaru class itself creates new objects for all the functions it redirects to. Perhaps this is the cause of the sluggishness?
Any ideas? Or maybe the demo loads pretty fast for you?













Email Blog Entry