File tree Expand file tree Collapse file tree 1 file changed +16
-0
lines changed
Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -2,6 +2,10 @@ require "json"
22
33package = JSON . parse ( File . read ( File . join ( __dir__ , "package.json" ) ) )
44
5+ # TODO: Should be customizable in package.json.
6+ # Used to create comparable benchmark results
7+ performance_mode = 1
8+
59Pod ::Spec . new do |s |
610 s . name = "RNQuickSQLite"
711 s . version = package [ "version" ]
@@ -35,6 +39,18 @@ Pod::Spec.new do |s|
3539 s . dependency "React-Core"
3640 end
3741
42+ optimizedCflags = '$(inherited) -DSQLITE_DQS=0 -DSQLITE_DEFAULT_MEMSTATUS=0 -DSQLITE_DEFAULT_WAL_SYNCHRONOUS=1 -DSQLITE_LIKE_DOESNT_MATCH_BLOBS=1 -DSQLITE_MAX_EXPR_DEPTH=0 -DSQLITE_OMIT_DEPRECATED=1 -DSQLITE_OMIT_PROGRESS_CALLBACK=1 -DSQLITE_OMIT_SHARED_CACHE=1 -DSQLITE_USE_ALLOCA=1'
43+
44+ if performance_mode == '1' then
45+ log_message . call ( "Thread unsafe (1) performance mode enabled. Use only transactions! 🚀🚀" )
46+ xcconfig [ :OTHER_CFLAGS ] = optimizedCflags + ' -DSQLITE_THREADSAFE=0 '
47+ end
48+
49+ if performance_mode == '2' then
50+ log_message . call ( "Thread safe (2) performance mode enabled 🚀" )
51+ xcconfig [ :OTHER_CFLAGS ] = optimizedCflags + ' -DSQLITE_THREADSAFE=1 '
52+ end
53+
3854 if ENV [ 'QUICK_SQLITE_USE_PHONE_VERSION' ] == '1' then
3955 s . exclude_files = "cpp/sqlite3.c" , "cpp/sqlite3.h"
4056 s . library = "sqlite3"
You can’t perform that action at this time.
0 commit comments