Fossil SCM
*** TEST only, not to be committed to trunk *** Reads sqlite cache pragma setting from env var. See forum posting by Dan Shearer "Fossil cache speedups"
Commit
bce3a5a5d4ac2f4bb50c6478a2abf096a97d4ffbab41f08395416978b1dca125
Parent
51bbcb1191675a1…
1 file changed
+7
M
src/db.c
+7
| --- src/db.c | ||
| +++ src/db.c | ||
| @@ -2761,10 +2761,17 @@ | ||
| 2761 | 2761 | } |
| 2762 | 2762 | } |
| 2763 | 2763 | g.zRepositoryName = fossil_strdup(zDbName); |
| 2764 | 2764 | db_open_or_attach(g.zRepositoryName, "repository"); |
| 2765 | 2765 | g.repositoryOpen = 1; |
| 2766 | + { | |
| 2767 | + /* TESTING FIXME set SQL cache size from environment FIXME */ | |
| 2768 | + const char *zCS = getenv("FOSSIL_SQLCACHE"); | |
| 2769 | + if( zCS!=0 && atoi(zCS)!=0 ){ | |
| 2770 | + db_multi_exec("PRAGMA repository.cache_size=%d;", atoi(zCS)); | |
| 2771 | + } | |
| 2772 | + } | |
| 2766 | 2773 | sqlite3_file_control(g.db, "repository", SQLITE_FCNTL_DATA_VERSION, |
| 2767 | 2774 | &g.iRepoDataVers); |
| 2768 | 2775 | |
| 2769 | 2776 | /* Cache "allow-symlinks" option, because we'll need it on every stat call */ |
| 2770 | 2777 | g.allowSymlinks = db_get_boolean("allow-symlinks",0); |
| 2771 | 2778 |
| --- src/db.c | |
| +++ src/db.c | |
| @@ -2761,10 +2761,17 @@ | |
| 2761 | } |
| 2762 | } |
| 2763 | g.zRepositoryName = fossil_strdup(zDbName); |
| 2764 | db_open_or_attach(g.zRepositoryName, "repository"); |
| 2765 | g.repositoryOpen = 1; |
| 2766 | sqlite3_file_control(g.db, "repository", SQLITE_FCNTL_DATA_VERSION, |
| 2767 | &g.iRepoDataVers); |
| 2768 | |
| 2769 | /* Cache "allow-symlinks" option, because we'll need it on every stat call */ |
| 2770 | g.allowSymlinks = db_get_boolean("allow-symlinks",0); |
| 2771 |
| --- src/db.c | |
| +++ src/db.c | |
| @@ -2761,10 +2761,17 @@ | |
| 2761 | } |
| 2762 | } |
| 2763 | g.zRepositoryName = fossil_strdup(zDbName); |
| 2764 | db_open_or_attach(g.zRepositoryName, "repository"); |
| 2765 | g.repositoryOpen = 1; |
| 2766 | { |
| 2767 | /* TESTING FIXME set SQL cache size from environment FIXME */ |
| 2768 | const char *zCS = getenv("FOSSIL_SQLCACHE"); |
| 2769 | if( zCS!=0 && atoi(zCS)!=0 ){ |
| 2770 | db_multi_exec("PRAGMA repository.cache_size=%d;", atoi(zCS)); |
| 2771 | } |
| 2772 | } |
| 2773 | sqlite3_file_control(g.db, "repository", SQLITE_FCNTL_DATA_VERSION, |
| 2774 | &g.iRepoDataVers); |
| 2775 | |
| 2776 | /* Cache "allow-symlinks" option, because we'll need it on every stat call */ |
| 2777 | g.allowSymlinks = db_get_boolean("allow-symlinks",0); |
| 2778 |