From 06d7649ffca90f243d98e9c7b308b4befed60662 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20Canna=C3=B2?= Date: Tue, 29 Nov 2016 13:40:20 +0000 Subject: [PATCH] Reduce allocations in SQLite3_row #809 This optimization, combined with the optimization already applied in #802, improves the execution time of LOAD MYSQL USERS TO RUNTIME by 12x --- include/sqlite3db.h | 61 +++++++++++++++++++++++++++++++++++---------- 1 file changed, 48 insertions(+), 13 deletions(-) diff --git a/include/sqlite3db.h b/include/sqlite3db.h index 18a4d84d1..eb6739607 100644 --- a/include/sqlite3db.h +++ b/include/sqlite3db.h @@ -15,19 +15,24 @@ class SQLite3_row { int cnt; int *sizes; char **fields; + char *data; SQLite3_row(int c) { sizes=(int *)malloc(sizeof(int)*c); fields=(char **)malloc(sizeof(char *)*c); memset(fields,0,sizeof(char *)*c); cnt=c; + data=NULL; }; ~SQLite3_row() { - int i=0; - for (i=0;i