XML_Transformer Debug Code
| From: | Joshua Eichorn | Date: | Fri, 22 Aug 2003 01:25:05 +0000 |
| Subject: | XML_Transformer Debug Code | ||
| Groups: | php.pear.dev | ||
| Request: | Send a blank email to pear-dev+get-20354@lists.php.net to get a copy of this message | ||
I have concerns about the debug code in XMl_Transformer.
I was running an XML_Transform that takes about 1.5 seconds, so i started to look for places to optimize (XDebug's profiller wasn't much help btw because i couldn't seem to get it to give me any aggregate stats).
Looking through the Transformer class i noticed that the debug code is always run its output is just ignored.
By wrapping all the calls to $this->_debug() in if($this->_debug()) { i was able to save about .45 seconds.
From my quick look this looks like a backwards compatible change so it would be a nice speed fix to roll out in the next release.
In the end my main problem was having the transformer set for recursive operation when i didn't need it, but the fixing of needless calls to sprinf and XML_Transformer_Util::attributesToString you get a big speed fix for free.
Let me know if you want a patch for this or if you have another solution. (one might be having a debug version of the class)
thanks
-joshua eichorn