Answer the question
In order to leave comments, you need to log in
How to check speed in MODX?
Generally got the site. It's on MODX, we need to optimize it. I don't even know where to start. Everywhere they write - to work with the cache, but they write that in places where there are some checks - it is not desirable. And I have snippets with parameters in my code - snippets. There are 2 pdoMenu + pdoPage on one page, and if pdoPage is called with caching (ie ), then a full ... guard is created. + there are subdomains managed through the same admin panel and there are many checks on the site itself. There are snippets made as snippets (this is for displaying prices, etc.), and there are made in chunks via http://askmeplz.com/. And I don't know what can be cached and what can't. Is it possible to measure the speed in different parts of the template in general? How much time is spent on such and such a piece, how much on another?
Answer the question
In order to leave comments, you need to log in
<?php
define('MODX_API_MODE', true);
require 'index.php';
$pdo = $modx->getService('pdoTools');
$tpl = '@INLINE <p> - - </p>';
$output = '';
for ($i = 0; $i <= 10000; $i ++) {
$array = array('val1' => rand(), 'val2' => rand(), 'val3' => rand());
$output .= $pdo->getChunk($tpl, $array);
}
echo '<pre>'; print_r($pdo->getTime()); echo '</pre>';
echo $output;
See what queries are being made and make those queries directly with EXPLAIN SELECT
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question