Skip to main content
Topic: Improve/measure performances (Read 1878 times) previous topic - next topic - Topic derived from Simple Audio Video Embedder
0 Members and 1 Guest are viewing this topic.

Improve/measure performances

Quote from: TE – Performance is probably server  and Settings related.
1) enable CSS & Javascript minification in ElkArte
2) disable hostname lookups in ElkArte
3) use a caching mechanism, if available (XCache, Memcached ..)
4) try to switch between normal and persistent database Connections (some Hosts don't like persistent mysql Connections)
1 & 2 should be done by default. If people are comparing base installation speed, give Elkarte the upper-hand.

Probably a micro optimization, but it would be interesting...
Right now Elkarte does output buffering so it doesn't send any content before sending headers. This is essentially the equivalent of creating a string. On this page, that would equate to a string that it s >112KB. The idea is to turn off output buffering when you get to the templates. That will then send output directly to the client and then they can start parsing it. What about gzipping? Well, you let the web server handle it. This would all just be an option though. And the only way to test it is with ab.

The other option is to do ob_flush(); flush(); before template_body_above().

Also add in some more time tracking. See how long it takes to get to ob_exit(). That's how long the controller took to get everything. Then see how long it takes to output the data. For performance testing, you could log the timings to a file. Give every request a unique id: $req_id = microtime(true) . ':' . rand(1, 1000); then just keep logging away.

Code: [Select]
$req_id = microtime(true) . ':' . rand(1, 1000);

/**
 * @param string $tag
 */
function logTimings($tag)
{
global $req_id;

$message = implode(' ', array(
$_SERVER['REQUEST_TIME'], // When the request started (could change to REQUEST_TIME_FLOAT if PHP >= 5.4
$req_id,
'"' . $tag . '"', // What is starting/stopping
));

file_put_contents('timings.log', $message, FILE_APPEND);
}
There are better ways to do this... XHProf

You guys should add Boomerang to this site: http://lognormal.github.io/boomerang/doc/ not sure how to handle the results though. Never used it, just see a lot of people talking about it.