aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authordrh <drh@noemail.net>2017-01-19 21:20:11 +0000
committerdrh <drh@noemail.net>2017-01-19 21:20:11 +0000
commit8674e49214c8d9a0e23cf46c15d6bd4b74b00c4d (patch)
treee5cd2205908cc84db5d5ea1e439ddc17c1401b78 /src
parent2f31d0204960ccfae468cef94a0447311b9bb143 (diff)
downloadsqlite-8674e49214c8d9a0e23cf46c15d6bd4b74b00c4d.tar.gz
sqlite-8674e49214c8d9a0e23cf46c15d6bd4b74b00c4d.zip
If compiled with SQLITE_INLINE_MEMCPY, all memcpy() calls are replaced with
in-line code. With that change, cachegrind shows which memcpy() calls are taking the most time. This is a performance-measurement hack only and is not for production use. FossilOrigin-Name: 9ed38521617136223a667988aed40e25797faf84
Diffstat (limited to 'src')
-rw-r--r--src/loadext.c1
-rw-r--r--src/resolve.c2
-rw-r--r--src/sqliteInt.h12
-rw-r--r--src/table.c2
4 files changed, 12 insertions, 5 deletions
diff --git a/src/loadext.c b/src/loadext.c
index 6011fd2bf..3296be60d 100644
--- a/src/loadext.c
+++ b/src/loadext.c
@@ -18,7 +18,6 @@
#endif
#include "sqlite3ext.h"
#include "sqliteInt.h"
-#include <string.h>
#ifndef SQLITE_OMIT_LOAD_EXTENSION
/*
diff --git a/src/resolve.c b/src/resolve.c
index dac73e5fa..7d89b6fec 100644
--- a/src/resolve.c
+++ b/src/resolve.c
@@ -15,8 +15,6 @@
** table and column.
*/
#include "sqliteInt.h"
-#include <stdlib.h>
-#include <string.h>
/*
** Walk the expression tree pExpr and increase the aggregate function
diff --git a/src/sqliteInt.h b/src/sqliteInt.h
index d5ac957d2..6344cac5f 100644
--- a/src/sqliteInt.h
+++ b/src/sqliteInt.h
@@ -512,6 +512,18 @@
#include <stddef.h>
/*
+** Use a macro to replace memcpy() if compiled with SQLITE_INLINE_MEMCPY.
+** This allows better measurements of where memcpy() is used when running
+** cachegrind. But this macro version of memcpy() is very slow so it
+** should not be used in production. This is a performance measurement
+** hack only.
+*/
+#ifdef SQLITE_INLINE_MEMCPY
+# define memcpy(D,S,N) {char*xxd=(char*)(D);const char*xxs=(const char*)(S);\
+ int xxn=(N);while(xxn-->0)*(xxd++)=*(xxs++);}
+#endif
+
+/*
** If compiling for a processor that lacks floating point support,
** substitute integer for floating-point
*/
diff --git a/src/table.c b/src/table.c
index a50d83ce6..c79255f99 100644
--- a/src/table.c
+++ b/src/table.c
@@ -17,8 +17,6 @@
** if they are not used.
*/
#include "sqliteInt.h"
-#include <stdlib.h>
-#include <string.h>
#ifndef SQLITE_OMIT_GET_TABLE