Skip to content

Instantly share code, notes, and snippets.

@jpauli
Created April 23, 2012 13:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jpauli/2471030 to your computer and use it in GitHub Desktop.
Save jpauli/2471030 to your computer and use it in GitHub Desktop.
libmysql VS mysqlnd read-only resultset allocations with buffered queries (store mode)
---- libmysql in store result mode ----
206 1,035,035,700 24,367,728 24,177,686 190,042 0
99.22% (24,177,686B) (heap allocation functions) malloc/new/new[], --alloc-fns, etc.
->88.15% (21,479,147B) 0x52DD010: my_malloc (my_malloc.c:37)
| ->88.04% (21,452,640B) 0x52E0583: alloc_root (my_alloc.c:219)
| | ->44.60% (10,869,120B) 0x5307A1F: cli_read_rows (client.c:1416)
| | | ->44.60% (10,869,120B) 0x5305955: mysql_store_result (client.c:2957)
| | | | ->44.60% (10,869,120B) 0x53EF09: zif_mysqli_query (mysqli_nonapi.c:540)
| | | | ->44.60% (10,869,120B) 0x70186A: zend_do_fcall_common_helper_SPEC (zend_vm_execute.h:320)
| | | | ->44.60% (10,869,120B) 0x6D9D96: execute (zend_vm_execute.h:107)
| | | | ->44.60% (10,869,120B) 0x6B4B98: zend_execute_scripts (zend.c:1236)
| | | | ->44.60% (10,869,120B) 0x663D0C: php_execute_script (main.c:2308)
| | | | ->44.60% (10,869,120B) 0x73BCDC: main (php_cli.c:1184)
| | | |
| | | ->00.00% (0B) in 1+ places, all below ms_print's threshold (01.00%)
| | |
| | ->43.40% (10,575,360B) 0x5307A40: cli_read_rows (client.c:1418)
| | | ->43.40% (10,575,360B) 0x5305955: mysql_store_result (client.c:2957)
| | | ->43.40% (10,575,360B) 0x53EF09: zif_mysqli_query (mysqli_nonapi.c:540)
| | | ->43.40% (10,575,360B) 0x70186A: zend_do_fcall_common_helper_SPEC (zend_vm_execute.h:320)
| | | ->43.40% (10,575,360B) 0x6D9D96: execute (zend_vm_execute.h:107)
| | | ->43.40% (10,575,360B) 0x6B4B98: zend_execute_scripts (zend.c:1236)
| | | ->43.40% (10,575,360B) 0x663D0C: php_execute_script (main.c:2308)
| | | ->43.40% (10,575,360B) 0x73BCDC: main (php_cli.c:1184)
| | |
| | ->00.03% (8,160B) in 1+ places, all below ms_print's threshold (01.00%)
| |
| ->00.11% (26,507B) in 1+ places, all below ms_print's threshold (01.00%)
|
...
---- mysqlnd in store result mode ----
229 1,349,008,664 17,873,408 16,121,319 1,752,089 0
90.20% (16,121,319B) (heap allocation functions) malloc/new/new[], --alloc-fns, etc.
->41.07% (7,340,032B) 0x6B0B8E: _zend_mm_alloc_int (zend_alloc.c:1908)
| ->20.53% (3,670,016B) 0x670A3D: _mysqlnd_pemalloc (mysqlnd_debug.c:864)
| | ->20.53% (3,670,016B) 0x66D40E: php_mysqlnd_res_store_result_fetch_data_pub (mysqlnd_result.c:1224)
| | ->20.53% (3,670,016B) 0x66C57F: php_mysqlnd_res_store_result_pub (mysqlnd_result.c:1308)
| | ->20.53% (3,670,016B) 0x660CED: php_mysqlnd_conn_store_result_pub (mysqlnd.c:2196)
| | ->20.53% (3,670,016B) 0x53D332: zif_mysqli_query (mysqli_nonapi.c:540)
| | ->20.53% (3,670,016B) 0x7183DA: zend_do_fcall_common_helper_SPEC (zend_vm_execute.h:320)
| | ->20.53% (3,670,016B) 0x6F0906: execute (zend_vm_execute.h:107)
| | ->20.53% (3,670,016B) 0x6CB708: zend_execute_scripts (zend.c:1236)
| | ->20.53% (3,670,016B) 0x67A87C: php_execute_script (main.c:2308)
| | ->20.53% (3,670,016B) 0x75284C: main (php_cli.c:1184)
| |
| ->16.13% (2,883,584B) 0x666101: php_mysqlnd_rowp_read_text_protocol (mysqlnd_wireprotocol.c:1313)
| | ->16.13% (2,883,584B) 0x66CF7A: mysqlnd_fetch_row_buffered (mysqlnd_result.c:1043)
| | ->16.13% (2,883,584B) 0x66C439: php_mysqlnd_res_fetch_into_pub (mysqlnd_result.c:1548)
| | ->16.13% (2,883,584B) 0x532550: php_mysqli_fetch_into_hash (mysqli.c:1257)
| | ->16.13% (2,883,584B) 0x5393B4: zif_mysqli_fetch_row (mysqli_api.c:1185)
| | ->16.13% (2,883,584B) 0x7183DA: zend_do_fcall_common_helper_SPEC (zend_vm_execute.h:320)
| | ->16.13% (2,883,584B) 0x6F0906: execute (zend_vm_execute.h:107)
| | ->16.13% (2,883,584B) 0x6CB708: zend_execute_scripts (zend.c:1236)
| | ->16.13% (2,883,584B) 0x67A87C: php_execute_script (main.c:2308)
| | ->16.13% (2,883,584B) 0x75284C: main (php_cli.c:1184)
| |
| ->02.93% (524,288B) 0x6C09A4: init_executor (zend_execute.h:163)
| | ->02.93% (524,288B) 0x6CC631: zend_activate (zend.c:851)
| | ->02.93% (524,288B) 0x67B707: php_request_startup (main.c:1435)
| | ->02.93% (524,288B) 0x752337: main (php_cli.c:1080)
| |
| ->01.47% (262,144B) 0x6B0FFA: zend_mm_shutdown (zend_alloc.c:1667)
| | ->01.47% (262,144B) 0x67C280: php_module_startup (main.c:2137)
| | ->01.47% (262,144B) 0x75108B: php_cli_startup (php_cli.c:398)
| | ->01.47% (262,144B) 0x751959: main (php_cli.c:770)
| |
| ->00.00% (0B) in 1+ places, all below ms_print's threshold (01.00%)
|
->20.53% (3,670,016B) 0x6B190D: _zend_mm_realloc_int (zend_alloc.c:2218)
| ->20.53% (3,670,016B) 0x67112B: _mysqlnd_perealloc (mysqlnd_debug.c:1002)
| ->20.53% (3,670,016B) 0x66D1E7: php_mysqlnd_res_store_result_fetch_data_pub (mysqlnd_result.c:1189)
| ->20.53% (3,670,016B) 0x66C57F: php_mysqlnd_res_store_result_pub (mysqlnd_result.c:1308)
| ->20.53% (3,670,016B) 0x660CED: php_mysqlnd_conn_store_result_pub (mysqlnd.c:2196)
| ->20.53% (3,670,016B) 0x53D332: zif_mysqli_query (mysqli_nonapi.c:540)
| ->20.53% (3,670,016B) 0x7183DA: zend_do_fcall_common_helper_SPEC (zend_vm_execute.h:320)
| ->20.53% (3,670,016B) 0x6F0906: execute (zend_vm_execute.h:107)
| ->20.53% (3,670,016B) 0x6CB708: zend_execute_scripts (zend.c:1236)
| ->20.53% (3,670,016B) 0x67A87C: php_execute_script (main.c:2308)
| ->20.53% (3,670,016B) 0x75284C: main (php_cli.c:1184)
|
->18.16% (3,245,343B) 0x67096B: _mysqlnd_malloc (mysqlnd_debug.c:1086)
| ->15.79% (2,821,448B) 0x671B92: mysqlnd_mempool_get_chunk (mysqlnd_block_alloc.c:120)
| | ->15.79% (2,821,448B) 0x668687: php_mysqlnd_rowp_read (mysqlnd_wireprotocol.c:1141)
| | ->15.79% (2,821,448B) 0x66D1B6: php_mysqlnd_res_store_result_fetch_data_pub (mysqlnd_result.c:1177)
| | ->15.79% (2,821,448B) 0x66C57F: php_mysqlnd_res_store_result_pub (mysqlnd_result.c:1308)
| | ->15.79% (2,821,448B) 0x660CED: php_mysqlnd_conn_store_result_pub (mysqlnd.c:2196)
| | ->15.79% (2,821,448B) 0x53D332: zif_mysqli_query (mysqli_nonapi.c:540)
| | ->15.79% (2,821,448B) 0x7183DA: zend_do_fcall_common_helper_SPEC (zend_vm_execute.h:320)
| | ->15.79% (2,821,448B) 0x6F0906: execute (zend_vm_execute.h:107)
| | ->15.79% (2,821,448B) 0x6CB708: zend_execute_scripts (zend.c:1236)
| | ->15.79% (2,821,448B) 0x67A87C: php_execute_script (main.c:2308)
| | ->15.79% (2,821,448B) 0x75284C: main (php_cli.c:1184)
| |
| ->02.28% (407,895B) 0x671BFB: mysqlnd_mempool_get_chunk (mysqlnd_block_alloc.c:133)
| | ->02.28% (407,895B) 0x668687: php_mysqlnd_rowp_read (mysqlnd_wireprotocol.c:1141)
| | ->02.28% (407,895B) 0x66D1B6: php_mysqlnd_res_store_result_fetch_data_pub (mysqlnd_result.c:1177)
| | ->02.28% (407,895B) 0x66C57F: php_mysqlnd_res_store_result_pub (mysqlnd_result.c:1308)
| | ->02.28% (407,895B) 0x660CED: php_mysqlnd_conn_store_result_pub (mysqlnd.c:2196)
| | ->02.28% (407,895B) 0x53D332: zif_mysqli_query (mysqli_nonapi.c:540)
| | ->02.28% (407,895B) 0x7183DA: zend_do_fcall_common_helper_SPEC (zend_vm_execute.h:320)
| | ->02.28% (407,895B) 0x6F0906: execute (zend_vm_execute.h:107)
| | ->02.28% (407,895B) 0x6CB708: zend_execute_scripts (zend.c:1236)
| | ->02.28% (407,895B) 0x67A87C: php_execute_script (main.c:2308)
| | ->02.28% (407,895B) 0x75284C: main (php_cli.c:1184)
| |
| ->00.09% (16,000B) in 1+ places, all below ms_print's threshold (01.00%)
|
...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment