Speed up SQLite3Result::fetchArray() by caching column names

Closes GH-7505.
This commit is contained in:
git@k47.cz 2021-09-20 23:34:37 +02:00 committed by Nikita Popov
parent 1ea58832e2
commit 1487dd03bc
3 changed files with 81 additions and 5 deletions

View file

@ -107,6 +107,11 @@ struct _php_sqlite3_result_object {
php_sqlite3_stmt *stmt_obj;
zval stmt_obj_zval;
/* Cache of column names to speed up repeated fetchArray(SQLITE3_ASSOC) calls.
* Cache is cleared on reset() and finalize() calls. */
int column_count;
zend_string **column_names;
int is_prepared_statement;
zend_object zo;
};