mirror of
https://github.com/php/php-src.git
synced 2025-08-16 05:58:45 +02:00
Use more compact representation for packed arrays.
- for packed arrays we store just an array of zvals without keys. - the elements of packed array are accessible throuf as ht->arPacked[i] instead of ht->arData[i] - in addition to general ZEND_HASH_FOREACH_* macros, we introduced similar familied for packed (ZEND_HASH_PACKED_FORECH_*) and real hashes (ZEND_HASH_MAP_FOREACH_*) - introduced an additional family of macros to access elements of array (packed or real hashes) ZEND_ARRAY_ELEMET_SIZE, ZEND_ARRAY_ELEMET_EX, ZEND_ARRAY_ELEMET, ZEND_ARRAY_NEXT_ELEMENT, ZEND_ARRAY_PREV_ELEMENT - zend_hash_minmax() prototype was changed to compare only values Because of smaller data set, this patch may show performance improvement on some apps and benchmarks that use packed arrays. (~1% on PHP-Parser) TODO: - sapi/phpdbg needs special support for packed arrays (WATCH_ON_BUCKET). - zend_hash_sort_ex() may require converting packed arrays to hash.
This commit is contained in:
parent
0eb603e3bb
commit
90b7bde615
89 changed files with 3302 additions and 1664 deletions
|
@ -31,7 +31,7 @@ mysqlnd_minfo_print_hash(zval *values)
|
|||
zval *values_entry;
|
||||
zend_string *string_key;
|
||||
|
||||
ZEND_HASH_FOREACH_STR_KEY_VAL(Z_ARRVAL_P(values), string_key, values_entry) {
|
||||
ZEND_HASH_MAP_FOREACH_STR_KEY_VAL(Z_ARRVAL_P(values), string_key, values_entry) {
|
||||
convert_to_string(values_entry);
|
||||
php_info_print_table_row(2, ZSTR_VAL(string_key), Z_STRVAL_P(values_entry));
|
||||
} ZEND_HASH_FOREACH_END();
|
||||
|
@ -63,7 +63,7 @@ mysqlnd_minfo_dump_api_plugins(smart_str * buffer)
|
|||
HashTable *ht = mysqlnd_reverse_api_get_api_list();
|
||||
MYSQLND_REVERSE_API *ext;
|
||||
|
||||
ZEND_HASH_FOREACH_PTR(ht, ext) {
|
||||
ZEND_HASH_MAP_FOREACH_PTR(ht, ext) {
|
||||
if (buffer->s) {
|
||||
smart_str_appendc(buffer, ',');
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue