Clear, usable interfaces. Clean, accessible code.

Route 19

Logbook.

Benchmarking CodeIgniter Apr. 1 at 10:09 am

In trying to come to grips with my increased dependence on CodeIgniter over the past few months I’ve been looking for reasons to not use it on particular projects. I recently had an opportunity to subcontract on someone else’s “legacy” PHP code, written procedurally with a couple of includes for mysql and site-wide functions/variables.

It made me appreciate what a framework like CI does for clarity and efficiency even more. But it occurred to me that this kind of code might be lighter on memory usage, so I did a completely unscientific and lazy comparison using memory_get_usage() against a recent CI app.

The CI app was pulling 3 query results (~15 rows) from a database and processing them with auto_typography. The “legacy” app was using 1 query result set (4 rows) with no further processing, so it should obviously be lighter.

CI 1.6.1 weighed in at 1.32 Mb.
Legacy was just 0.82 Mb.

I’d like to try “recreate” this legacy app in CI for a closer comparison when I have the time, but I’m satisfied that CI isn’t hogging resources. Looking at a few other CI apps, I can’t find any single page over 1.4 Mb. Cacheing on this particular page moves memory usage from 1.3 Mb to 0.28 Mb — not to mention 0.0218 seconds to 0.0030 seconds processing time.

Recent Entries

More