Re: [PEPr] -1 for XML::XML_RPC2

From: Date: Thu, 12 May 2005 20:12:30 +0000
Subject: Re: [PEPr] -1 for XML::XML_RPC2
References: 1 2 3 4 5 6 7  Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-37605@lists.php.net to get a copy of this message
Sergio Carvalho wrote:
Also, in my benchmarking of PEAR, even with a cache like Zend Optimizer shows that the most expensive operation in PHP is require_once (yes, even with a stat cache, because the first time is not cached, and the inefficiency is per request, not within a request). Your code has more than 5 times the number of files that Chiara_XML_RPC5, and in addition, each class declaration takes much more time and memory than a method declaration. A single-method class should be a part of a parent class, or re-factored to work with other classes. You require people wishing to process values sent and returned from XML_RPC to create a huge number of objects. This will substantially increase memory usage, which is another unnecessary inefficiency.
I'm curious on your benchmarks. Sincerely curious. My experience is the opposite. At least on linux, the OS caches the stat info. You do incur a penalty the first time you check a file, but if the info doesn't leave the disk buffer, you pay nothing on subsequent requests. As for actually reading the file, it only happens on changes, for accelerated servers.
The most obvious difference was in the unit tests of PEAR. When I changed the require_once calls so that all files were require_once() only once, the speed of running all 639 tests went from something like 35 minutes to 18 minutes on my windows machine. The gentoo box dropped from 10 to 4 minutes, showing a cross-platform performance gain. Before, require_once was present in many loops. I recall posting about this on either pear-core or pear-dev, but would need to search to find the message.
I may need to refer to the actual type. Namely, when automatic mapping can't work: - PHP Arrays to either XML-RPC struct or XML-RPC array.
I find this decision rather simple: if there are any non-sequential or non-numeric indices, struct is used, otherwise array is used.
- PHP Strings to either XML-RPC string or XML-RPC base64 string.
This must be developer-based. I don't think you understand what I was saying with my comments on OO - you thought I was talking about XML_RPC2 when I was explaining what makes something OO, but I was talking about Chiara_XML_RPC5. Email is not always the clearest medium. The way I have people do this in Chiara_XML_RPC5 is: <?php $xmlrpc = new Chiara_XML_RPC5('http://example.com/xmlrpc.php'); $arr = array(1,2,'base64'); $xmlrpc->setType($arr[2], 'base64'); $result = $xmlrpc->someFunction($arr); ?>
- PHP ints to either XML-RPC int or XML-RPC dateTime.
Same as above example but use 'datetime' For the server end, the server has to create the values and use setType in the same manner. For other values, php provides clearer alternatives such as casting to a double from a string. Greg

« previous php.pear.dev (#37605) next »