On Wed, 2013-01-09 at 18:49 +0500, Ruslan Osmanov wrote: > > I don't have any benchmark on that level and there are many things > > influencing this, but the internal storage for all resources is a linked > > list, the object storage is an array. > > > > johannes > > Thanks. I'll keep going with resources then :)
Very quick test using a resource/object wrapping a single long value: $ git clone git://github.com/johannes/resvsobj.git $ cd resvsobj $ phpize && ./configure && make $ php -dmemory_limit=-1 -dextension=modules/resvsobj.so resvsobj.php 1000000 10 Creating 1000000 resources: 1.4985349178314 Calling add 10x/resource: 7.7992949485779 Freeing all (unset of array): 0.81038594245911 Creating 1000000 objects: 1.453381061554 Calling add 10x/object: 7.3565299510956 Freeing all (unset of array): 0.51739692687988 So on my machine with my PHP (debug) build objects are a tiny bit faster. Feel free to play with the code. johannes -- PECL development discussion Mailing List (http://pecl.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
