Optimized smart strings

From: Date: Mon, 20 Jun 2011 10:55:20 +0000
Subject: Optimized smart strings
Groups: php.internals 
Request: Send a blank email to internals+get-53376@lists.php.net to get a copy of this message
PHP makes use of the smart string library. I've optimized the smart_str_append_long() macro in order to save one division per cycle. At the moment one modulo and one division is used. The optimized version uses one division (which gets optimized away in most situations) and one additional multiplication + subtraction. I've additionally added also a new maco called smart_str_append_const(). This macro is used to append constant strings with a sizeof()-1 instead of strlen() "call". I'd be glad to see this change in 5.4. As I wrote in the earlier post, I'll deliver the patch in addition. PS: yes, this is a really small micro optimization. Robert

« previous php.internals (#53376) next »