Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:10875 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 71776 invoked by uid 1010); 2 Jul 2004 16:31:04 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 71753 invoked by uid 1007); 2 Jul 2004 16:31:03 -0000 To: internals@lists.php.net Date: Fri, 02 Jul 2004 19:30:47 +0300 Organization: none Content-Type: text/plain; format=flowed; delsp=yes; charset=koi8-r MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Message-ID: User-Agent: Opera M2/7.50 (Win32, build 3778) X-Posted-By: 62.32.51.198 Subject: small patch for implode() function From: valyala@tut.by ("Alexander Valyalkin") there is such code in the php_implode() function: [snip] while (zend_hash_get_current_data_ex(Z_ARRVAL_P(arr), (void **) &tmp, &pos) == SUCCESS) { SEPARATE_ZVAL(tmp); convert_to_string(*tmp); [snip] SEPARATE_ZVAL() always duplicates data of the tmp, even Z_TYPE_PP(tmp) == IS_STRING. It is terrible slowdowns the implode() function. So, changing the strings SEPARATE_ZVAL(tmp); convert_to_string(*tmp); to convert_to_string_ex(tmp); will increase speed twice, because most of elements in the imploding array has IS_STRING type. -- Using Opera's revolutionary e-mail client: http://www.opera.com/m2/