Hi,
On Thu, Jul 2, 2009 at 10:12 PM, Алексей Михеевamiheev@st-host.ru wrote:
Are you are trying to say that with once loaded, compiled and cached code there would be a difference between single and double quotes?
well, there are performance improvments with double quotes the PHP parser checks for variables inside the string itself, which (of course) costs (much) time with single quotes the interpreter handles everything inside the single-quotes as plain text, it does not even check for special characters (like \n) in there
And also you are saying that two functions which are both aliases to the same zend engine function there will be difference after compilation, especially when using Zend Accelerator or eAccelerator or XCache?
I have no clue about caching engines so I can't say anything here - sorry
And, most notably, do you really mean that all this stuff would relly matter with complex code and lots of IMAP and MySQL interaction?
well, of course this would not speed up MySQL queries or IMAP performance, but it would improve performance (at least a tiny bit - but sum that together...) everywhere you are doing stuff with strings (which is probably a quite big part of the code :))
Premature optimization is the root of all evil. Do you have any benchmarks? Did you profile the code and actually saw that concatenating stings takes at least 10% of running imap_open?
no, I haven't checked any of those cases specially for roundcube, but every language (no matter if it's a scripting language or any other language) has always more ways to archieve a goal. in java for example you can use StringBuilder instead of concatenating strings - StringBuilder will be faster (at least in most cases)
PS: as I said in my first mail - no huge performance improvements can be done by just using faster PHP-functions. but why not save some milliseconds here - some more there - and some more right behind that tree? :) if you sum everything up the result should be pretty OK
one last note: when you're testing - make sure your PHP environment is clean and you are testing under good conditions benchmarking PHP scripts is probably a bad idea when you are using 100% CPU and 100% RAM with other applications at the same time
Regards, Martin _______________________________________________ List info: http://lists.roundcube.net/dev/