Re: [PHP-DEV] [PATCH] More array filling optimizations

2008-04-30 Thread Dmitry Stogov
Hi Matt, I've made a review of your patch. At first it has a bug at least in array_psplice() that makes several tests to fail. So I removed the whole ext/standard part and tested only Zend Engine changes. Although the idea is interesting and implementation is perfect, the patch doesn't

Re: [PHP-DEV] [PATCH] More array filling optimizations

2008-04-30 Thread Dmitry Stogov
For some reason make test with the patch reported several broken array_splice() tests. Looking in gdb I saw that init_array() got -1 as a size of new array. I don't think checks for return_value_used for array_splice() have a lot of sense. Thanks. Dmitry. Matt Wilmas wrote: Hi Dmitry,

Re: [PHP-DEV] [PATCH] More array filling optimizations

2008-04-30 Thread Matt Wilmas
Hi again Dmitry, Hmm, if a -1 size was passed, I thought it would just make a huge array size (bad, obviously), but the tests would still work. (Or I guess it might exhaust memory_limit.) Anyway, the code for checking the size (length variable) in array_splice() is copied from php_splice(), so

Re: [PHP-DEV] [PATCH] More array filling optimizations

2008-04-30 Thread Matt Wilmas
Hi Dmitry, Yes, I noticed similar results with the compile/vm changes, and was also thinking that it probably wasn't worth doing, so I just left it as a separate patch in case someone else wanted to look into it. :-) So I guess the rest is OK other than array_splice() tests breaking... I didn't

Re: [PHP-DEV] [PATCH] More array filling optimizations

2008-04-30 Thread Dmitry Stogov
Matt Wilmas wrote: Hi again Dmitry, Hmm, if a -1 size was passed, I thought it would just make a huge array size (bad, obviously), but the tests would still work. (Or I guess it might exhaust memory_limit.) Anyway, the code for checking the size (length variable) in array_splice() is copied

[PHP-DEV] [PATCH] More array filling optimizations

2008-04-25 Thread Matt Wilmas
Hi all, Expanding on the idea of passing a size other than 0 to zend_hash_init(), when possible, which was done awhile ago in a few areas (to save resize/rehash operations), I finally added an array_init_size() that can be used instead of array_init(), likewise, when a size is known. As an

Re: [PHP-DEV] [PATCH] More array filling optimizations

2008-04-25 Thread Andrey Hristov
Hi, Matt Wilmas wrote: Hi all, Expanding on the idea of passing a size other than 0 to zend_hash_init(), when possible, which was done awhile ago in a few areas (to save resize/rehash operations), I finally added an array_init_size() that can be used instead of array_init(), likewise, when a

Re: [PHP-DEV] [PATCH] More array filling optimizations

2008-04-25 Thread Matt Wilmas
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) \

Re: [PHP-DEV] [PATCH] More array filling optimizations

2008-04-25 Thread Dmitry Stogov
Hi Matt, I like the idea (especially ZEND_INIT_ARRAY optimization) and from the first look patch seems proper. I'll need to look into it more careful before commit (probably on next week). Thanks. Dmitry. Matt Wilmas wrote: Hi all, Expanding on the idea of passing a size other than 0 to