diff options
author | Ben Avison <bavison@riscosopen.org> | 2014-02-24 15:03:03 +0000 |
---|---|---|
committer | Stefan Saraev <stefan@saraev.ca> | 2015-08-30 21:51:54 +0300 |
commit | 752f46fda3b8ac2dc2314494a61974ed93a0b440 (patch) | |
tree | f0dab0de126fde57910c2be16982f35db7147004 | |
parent | 715fc2afa690c164208e94b6b2d472318353feb7 (diff) |
Pre-populate the mmap'ed database file in SQLite.
The time taken to issue "SELECT * FROM tvshowview" in seconds improves
still further in this case.
Before After
Mean StdDev Mean StdDev Confidence Change
Time 2.550 0.021 2.375 0.043 100.0% +7.4%
Note, this requires the standard SQLite amalgamation tarball to be patched
prior to building. The change may not be desirable further upstream due to
the fact that it might cause database access times to increase in usage
scenarios that differ from those employed by XBMC.
-rw-r--r-- | tools/depends/target/sqlite3/Makefile | 1 | ||||
-rw-r--r-- | tools/depends/target/sqlite3/sqlite3.c.patch | 28 |
2 files changed, 29 insertions, 0 deletions
diff --git a/tools/depends/target/sqlite3/Makefile b/tools/depends/target/sqlite3/Makefile index e28cc3fdbe..f7e95be6e8 100644 --- a/tools/depends/target/sqlite3/Makefile +++ b/tools/depends/target/sqlite3/Makefile @@ -30,6 +30,7 @@ $(PLATFORM): $(TARBALLS_LOCATION)/$(ARCHIVE) $(DEPS) ifeq ($(OS),android) cd $(PLATFORM); patch -p0 < ../fix-32bits-on-64bits.patch endif + cd $(PLATFORM); patch -p1 < ../sqlite3.c.patch cd $(PLATFORM); $(CONFIGURE) $(LIBDYLIB): $(PLATFORM) diff --git a/tools/depends/target/sqlite3/sqlite3.c.patch b/tools/depends/target/sqlite3/sqlite3.c.patch new file mode 100644 index 0000000000..54ebf31299 --- /dev/null +++ b/tools/depends/target/sqlite3/sqlite3.c.patch @@ -0,0 +1,28 @@ +diff --git a/sqlite3.c b/sqlite3.c +index 1344938..c437252 100644 +--- a/sqlite3.c ++++ b/sqlite3.c +@@ -30750,7 +30750,11 @@ static void unixRemapfile( + pNew = osMremap(pOrig, nReuse, nNew, MREMAP_MAYMOVE); + zErr = "mremap"; + #else ++#if defined(MAP_POPULATE) ++ pNew = osMmap(pReq, nNew-nReuse, flags, MAP_SHARED | MAP_POPULATE, h, nReuse); ++#else + pNew = osMmap(pReq, nNew-nReuse, flags, MAP_SHARED, h, nReuse); ++#endif + if( pNew!=MAP_FAILED ){ + if( pNew!=pReq ){ + osMunmap(pNew, nNew - nReuse); +@@ -30769,7 +30773,11 @@ static void unixRemapfile( + + /* If pNew is still NULL, try to create an entirely new mapping. */ + if( pNew==0 ){ ++#if defined(MAP_POPULATE) ++ pNew = osMmap(0, nNew, flags, MAP_SHARED | MAP_POPULATE, h, 0); ++#else + pNew = osMmap(0, nNew, flags, MAP_SHARED, h, 0); ++#endif + } + + if( pNew==MAP_FAILED ){ |