2

Profiling a PHP application with Xdebug and KCacheGrind shows over 150% than (inclusive) spent in some functions. The app uses Smarty 3 and the strange functions are always in calls related to template processing. There are lots of loops in that area because of Smarty plugins loading other templates. Has anyone else met this phenomenon? Is it a problem with Xdebug somehow not being able to profile correctly the PHP files generated by Smarty, or KCacheGrind being confused by loops? How reliable is the conclusion that Smarty is the bottleneck?

Images:

Tgr
  • 27,442
  • 12
  • 81
  • 118
  • Any way you could post a screenshot of your kcachegrind showing these numbers? I'm trying to understand what you mean by "more than 100%". – glomad Mar 18 '11 at 14:08
  • @itchy: The time spent in a subroutine is apparently more than the time spent in the whole call. Added screenshots. – Tgr Mar 18 '11 at 14:58

1 Answers1

1

Profiling is currently broken in xdebug, see https://bugs.kde.org/show_bug.cgi?id=256425 - you may be experiencing that bug.

cweiske
  • 30,033
  • 14
  • 133
  • 194
  • If I understanc correctly, that bug results in every function appearing in duplicate - one version that has been called 0 times, and an other which ran 0 usecs. I did not experience that. Probably the version of KCacheGrind I use (a [windows port](http://sourceforge.net/projects/precompiledbin/) of QCachegrind 0.5.1) still has the old relaxed function merging behavior. – Tgr Mar 19 '11 at 09:49