[sqlite] SQLite take lower performance while using shared cache on iOS/Mac

2015-12-17 Thread sanhua.zh
I try to use shared cache to optimize my code. Sincesqlite3_enable_shared_cache is deprecated on iOS/Mac, I usesqlite3_open_v2 withSQLITE_OPEN_SHAREDCACHE flag to open shared cache mode. 4 threads select is running in my code, while each thread has its own sqlite connection and do the same thing

[sqlite] SQLite take lower performance while using shared cache on iOS/Mac

2015-12-17 Thread Scott Perry
Using a shared cache will result in lower memory usage and may result in lower IO, but it isn't likely to speed up your program since it also requires more locks to guarantee safety between competing database connections. SQLite on Apple's platforms is built with SQLITE_THREADSAFE=2, so under no