Outils pour utilisateurs

Outils du site


informatique:php:performance

Différences

Ci-dessous, les différences entre deux révisions de la page.

Lien vers cette vue comparative

Les deux révisions précédentesRévision précédente
Prochaine révision
Révision précédente
informatique:php:performance [16/04/2010 09:59] cyrilleinformatique:php:performance [23/07/2016 13:49] (Version actuelle) – [Profiling] nalyser les données du profiler de XDebug avec webgrind cyrille
Ligne 16: Ligne 16:
  
 Profile you code before you start optimizing it! Otherwise it would be like travelling around a foreign city with signs written in an unreadable language witout any map or GPS. You’ll probably get somewhere, but you wouldn’t have any idea where you are, where you should go and how far are you from the place you need to be. Profiling would allow you to know which parts of code are worth investing into and which aren’t. You can use [[http://www.zend.com/en/products/studio/|Zend Studio/Debugger]] or [[/informatique/php/XDebug|Xdebug]] for that. Profile you code before you start optimizing it! Otherwise it would be like travelling around a foreign city with signs written in an unreadable language witout any map or GPS. You’ll probably get somewhere, but you wouldn’t have any idea where you are, where you should go and how far are you from the place you need to be. Profiling would allow you to know which parts of code are worth investing into and which aren’t. You can use [[http://www.zend.com/en/products/studio/|Zend Studio/Debugger]] or [[/informatique/php/XDebug|Xdebug]] for that.
 +
 +  * https://docs.moodle.org/dev/Profiling_PHP
 +    * xdebug.profiler_enable_trigger = 1 with XDEBUG_PROFILE set in  GET/POST or COOKIE
 +    * ou xdebug.profiler_enable = 1
 +  * [[http://morefedora.blogspot.com/2008/05/profile-memory-usage-of-php-scripts.html|Profile memory usage of PHP scripts]] with xdebug
 +    * xdebug.auto_trace = On
 +    * xdebug.show_mem_delta = On
 +
 +Analyser les données du profiler de XDebug avec [[https://github.com/jokkedk/webgrind#readme|webgrind]].
  
 ==== Caching ==== ==== Caching ====
Ligne 25: Ligne 34:
 ==== Optimize your data ==== ==== Optimize your data ====
  
-Usually the most expensive places of the PHP application are where it accesses external data – namely, database or filesystem or network. Look hard into optimizing that – reduce number of queries, improve database structure, reduce filesystem accesses, try to bundle data to make one service call instead of several, etc. For more advanced in-depth look, use tools like strace (Unix) and Process Explorer (Windows) to look into system calls your script produces and think about ways to eliminate some of  them. You would not be able to eliminate all of them but each of them is a worthy target.+Usually the most expensive places of the PHP application are where it accesses external data – namely, database or file system or network. Look hard into optimizing that – reduce number of queries, improve database structure, reduce file system accesses, try to bundle data to make one service call instead of several, etc. For more advanced in-depth look, use tools like strace (Unix) and Process Explorer (Windows) to look into system calls your script produces and think about ways to eliminate some of  them. You would not be able to eliminate all of them but each of them is a worthy target.
  
 ==== Avoid extra notices/errors/etc ==== ==== Avoid extra notices/errors/etc ====
informatique/php/performance.1271404753.txt.gz · Dernière modification : 19/05/2012 00:15 (modification externe)

Sauf mention contraire, le contenu de ce wiki est placé sous les termes de la licence suivante : CC0 1.0 Universal
CC0 1.0 Universal Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki