Re: [PATCH] More array filling optimizations

From: Date: Fri, 25 Apr 2008 15:30:43 +0000
Subject: Re: [PATCH] More array filling optimizations
References: 1 2  Groups: php.internals 
Request: Send a blank email to internals+get-37217@lists.php.net to get a copy of this message
Hi Andrey, ----- Original Message ----- From: "Andrey Hristov" Sent: Friday, April 25, 2008 > Hi, > [...] > heh, this optimisitations was one of the pluses mysqlnd had over > mysqli/libmysql. I am using the following macro: > > #if PHP_MAJOR_VERSION < 6 > #define mysqlnd_array_init(arg, field_count) \ > { \ > ALLOC_HASHTABLE_REL(Z_ARRVAL_P(arg));\ > zend_hash_init(Z_ARRVAL_P(arg), (field_count), NULL, ZVAL_PTR_DTOR, 0); \ > Z_TYPE_P(arg) = IS_ARRAY;\ > } > #else > #define mysqlnd_array_init(arg, field_count) \ > { \ > ALLOC_HASHTABLE_REL(Z_ARRVAL_P(arg));\ > zend_u_hash_init(Z_ARRVAL_P(arg), (field_count), NULL, ZVAL_PTR_DTOR, > 0, 0);\ > Z_TYPE_P(arg) = IS_ARRAY;\ > } > #endif > Ah yes, I see. :-) Yeah, any of the database functions (in all DB exts.) that create/return arrays are one of the obvious things I had in mind to change, but hadn't come across your mysqlnd "workaround," heh. Just knew that plain array_init() is used in mysql/mysqli, pgsql, sqlite, etc... - Matt

« previous php.internals (#37217) next »