Re: Ruby's symbols

From: Date: Sat, 05 Jan 2013 17:43:43 +0000
Subject: Re: Ruby's symbols
References: 1 2 3 4  Groups: php.internals 
Request: Send a blank email to internals+get-64553@lists.php.net to get a copy of this message
On Sat, Jan 5, 2013 at 6:58 PM, Nikita Nefedov <inefedor@gmail.com> wrote:
** Though there would be a little speed-up because with Symbols array's Buckets will keep numeric key, so instead of memcmp you will need to just compare two longs when retrieving element.
Before memcmping the array keys PHP will first compare the pointers. For interned strings the pointers will be the same so the memcmp is not done. See http://lxr.php.net/xref/PHP_TRUNK/Zend/zend_hash.c#950.
My fault, didn't see it in the source...

« previous php.internals (#64553) next »