I’ve been doing some profiling of my cake apps. Found a decent improvement.For your production apps only
in core.prod.php change
Configure::write(‘log’, E_ERROR | E_WARNING);You don’t even know it (cuz it never logs) but because cake has backwards compatibility with php4, there are tons of notices and strict notices thrown that cake swollows. Thing is, there are 300+ of these every request – thats 300+ extra method and stack increases each request. The downside of my “fix” above is PHP warnings/errors will no longer be written to the tmp/logs/error.log – instead it will go to the generic php5-fpm /var/log log. Which to me is way worth the perf increase.
I opened a ticket u can read if u want more info – this should be a no-issue in cake 2.0.
Want to profile your app? I highly recomend http://www.xdebug.org/docs/profiler and easy x-debug plugin for Firefox. You can see my post on setting up a debugger for php and eclipse for more info.
1 thought on “cakephp 1.3 and php 5.3 performance improvement”
Nice! My app went from ~30 req/s to 35 req/s by disabling Cake’s error logging.I got an error when running shell tasks about DISABLE_DEFAULT_ERROR_HANDLING already being defined, but found it isn’t necessary to define the constant to get the nice speed bump 🙂