com php-src: Fixded bug #72736 (Slow performance when fetching large dataset with mysqli / PDO): NEWS Zend/zend_alloc.c

From: Date: Wed, 26 Oct 2016 12:17:09 +0000
Subject: com php-src: Fixded bug #72736 (Slow performance when fetching large dataset with mysqli / PDO): NEWS Zend/zend_alloc.c
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-95290@lists.php.net to get a copy of this message
Commit: 3fb0a1a4e75f1049afe6f6950a4b7171b81ba8b0 Author: Dmitry Stogov <dmitry@zend.com> Wed, 26 Oct 2016 15:17:09 +0300 Parents: 0f9a4af90bbaf35db41f2c5c9cfeb239e0576f7e Branches: PHP-7.0 PHP-7.1 master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=3fb0a1a4e75f1049afe6f6950a4b7171b81ba8b0 Log: Fixded bug #72736 (Slow performance when fetching large dataset with mysqli / PDO) Bugs: https://bugs.php.net/72736 Changed paths: M NEWS M Zend/zend_alloc.c Diff: diff --git a/NEWS b/NEWS index 20411a6..be6738a 100644 --- a/NEWS +++ b/NEWS @@ -2,7 +2,9 @@ PHP NEWS ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| ?? ??? 2016 PHP 7.0.14 - +- Core: + . Fixded bug #72736 (Slow performance when fetching large dataset with mysqli + / PDO). (Dmitry) 10 Nov 2016 PHP 7.0.13 diff --git a/Zend/zend_alloc.c b/Zend/zend_alloc.c index 40eb100..937340d 100644 --- a/Zend/zend_alloc.c +++ b/Zend/zend_alloc.c @@ -897,6 +897,7 @@ static void *zend_mm_alloc_pages(zend_mm_heap *heap, int pages_count ZEND_FILE_L { zend_mm_chunk *chunk = heap->main_chunk; int page_num, len; + int steps = 0; while (1) { if (UNEXPECTED(chunk->free_pages < pages_count)) { @@ -1073,10 +1074,20 @@ get_chunk: goto found; } else { chunk = chunk->next; + steps++; } } found: + if (steps > 2 && pages_count < 8) { + /* move chunk into the head of the linked-list */ + chunk->prev->next = chunk->next; + chunk->next->prev = chunk->prev; + chunk->next = heap->main_chunk->next; + chunk->prev = heap->main_chunk; + chunk->prev->next = chunk; + chunk->next->prev = chunk; + } /* mark run as allocated */ chunk->free_pages -= pages_count; zend_mm_bitset_set_range(chunk->free_map, page_num, pages_count);

« previous php.cvs (#95290) next »