Profiling Analyzes of Jaws

written by Mirco Bauer

Jaws has some major problem with performance, the reason is partly known but not well addressed yet, this page tries to change this.

My profiling results are done using Zend Studio 4.0.2 on with a AMD64 3000+ server having Jaws installed. The testpage is, a normal jaws based site I would say, using a few features here and there.

Time for some numbers… I will make a top 5 of functions that use most time. Btw, all percentage numbers are always total time of the whole request!

Profile-Case 1 using loading default gadget (blog)

Execution time: 199ms

  1. 37% blog::view
    • each blog::showentry() uses about 5%, mostly caused by parseText with SyntaxHighlighting
  2. 14% jawsapplication::create
  3. 8% jawsgadget::init
  4. ~5% each time jawslayout::putgadget is called (5 times per request)
    • this can also go up to 30%, because the actual gadget becomes processed here, like blog
  5. 3% JawsXSS.php
  6. 2% JawsCommonIncludes (mainly by Piwi.php, before Smart Piwi this was 15%!)

Conclusion of Profile-Case 1

The actual gadget in this case blog is using a lot time, this is mostly caused by all plugins running for each blog posts, the syntax highlighter uses 4.5% per call. This makes no sense because all my blog entries have any code snippets! Each plugin should have a NeedsParsing() method which returns false or true if _any_ tag was really used which is _related_ to the plugin, don’t let the complex parser run when when there is nothing to parse/change. ParseText() should always call NeedsParsing() before it really does the complex parsing part. NeedsParsing() should do a _simple_ analyze, it must not be very accurate, this could be done using strpos() for instance which is very fast.


I implemented the NeedsParsing() method in the SyntaxHighlight and changed it to use “lazy class loading”, now the execution time is down to 189ms, that’s 10ms less!

  /var/www/wiki/htdocs/data/jaws/profiling.txt · Last modified: 2007/11/02 16:27