Fossil SCM

Set SQLite page cache to 32,000 KiB (repository.cache_size=-32000) and Fossil content-cache to 2000 artifacts + 256,000,000 bytes. Improves performance on rebuild, test-integrity and export. See [forum:e5d056e719685108|forum post e5d056e719685108].

danshearer 2026-10-20 07:47 UTC trunk
Commit 003f490d9fc16179bf51f31f1e298dfd25cac90958abec52142d9ce17321f84c
2 files changed +2 -2 +1
+2 -2
--- src/content.c
+++ src/content.c
@@ -77,16 +77,16 @@
7777
** This routines hands responsibility for the artifact over to the cache.
7878
** The cache will deallocate memory when it has finished with it.
7979
*/
8080
void content_cache_insert(int rid, Blob *pBlob){
8181
struct cacheLine *p;
82
- if( contentCache.n>500 || contentCache.szTotal>50000000 ){
82
+ if( contentCache.n>2000 || contentCache.szTotal>256000000 ){
8383
i64 szBefore;
8484
do{
8585
szBefore = contentCache.szTotal;
8686
content_cache_expire_oldest();
87
- }while( contentCache.szTotal>50000000 && contentCache.szTotal<szBefore );
87
+ }while( contentCache.szTotal>256000000 && contentCache.szTotal<szBefore );
8888
}
8989
if( contentCache.n>=contentCache.nAlloc ){
9090
contentCache.nAlloc = contentCache.nAlloc*2 + 10;
9191
contentCache.a = fossil_realloc(contentCache.a,
9292
contentCache.nAlloc*sizeof(contentCache.a[0]));
9393
--- src/content.c
+++ src/content.c
@@ -77,16 +77,16 @@
77 ** This routines hands responsibility for the artifact over to the cache.
78 ** The cache will deallocate memory when it has finished with it.
79 */
80 void content_cache_insert(int rid, Blob *pBlob){
81 struct cacheLine *p;
82 if( contentCache.n>500 || contentCache.szTotal>50000000 ){
83 i64 szBefore;
84 do{
85 szBefore = contentCache.szTotal;
86 content_cache_expire_oldest();
87 }while( contentCache.szTotal>50000000 && contentCache.szTotal<szBefore );
88 }
89 if( contentCache.n>=contentCache.nAlloc ){
90 contentCache.nAlloc = contentCache.nAlloc*2 + 10;
91 contentCache.a = fossil_realloc(contentCache.a,
92 contentCache.nAlloc*sizeof(contentCache.a[0]));
93
--- src/content.c
+++ src/content.c
@@ -77,16 +77,16 @@
77 ** This routines hands responsibility for the artifact over to the cache.
78 ** The cache will deallocate memory when it has finished with it.
79 */
80 void content_cache_insert(int rid, Blob *pBlob){
81 struct cacheLine *p;
82 if( contentCache.n>2000 || contentCache.szTotal>256000000 ){
83 i64 szBefore;
84 do{
85 szBefore = contentCache.szTotal;
86 content_cache_expire_oldest();
87 }while( contentCache.szTotal>256000000 && contentCache.szTotal<szBefore );
88 }
89 if( contentCache.n>=contentCache.nAlloc ){
90 contentCache.nAlloc = contentCache.nAlloc*2 + 10;
91 contentCache.a = fossil_realloc(contentCache.a,
92 contentCache.nAlloc*sizeof(contentCache.a[0]));
93
+1
--- src/db.c
+++ src/db.c
@@ -2761,10 +2761,11 @@
27612761
}
27622762
}
27632763
g.zRepositoryName = fossil_strdup(zDbName);
27642764
db_open_or_attach(g.zRepositoryName, "repository");
27652765
g.repositoryOpen = 1;
2766
+ db_multi_exec("PRAGMA repository.cache_size=-32000");
27662767
sqlite3_file_control(g.db, "repository", SQLITE_FCNTL_DATA_VERSION,
27672768
&g.iRepoDataVers);
27682769
27692770
/* Cache "allow-symlinks" option, because we'll need it on every stat call */
27702771
g.allowSymlinks = db_get_boolean("allow-symlinks",0);
27712772
--- src/db.c
+++ src/db.c
@@ -2761,10 +2761,11 @@
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,11 @@
2761 }
2762 }
2763 g.zRepositoryName = fossil_strdup(zDbName);
2764 db_open_or_attach(g.zRepositoryName, "repository");
2765 g.repositoryOpen = 1;
2766 db_multi_exec("PRAGMA repository.cache_size=-32000");
2767 sqlite3_file_control(g.db, "repository", SQLITE_FCNTL_DATA_VERSION,
2768 &g.iRepoDataVers);
2769
2770 /* Cache "allow-symlinks" option, because we'll need it on every stat call */
2771 g.allowSymlinks = db_get_boolean("allow-symlinks",0);
2772

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button