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].
Commit
003f490d9fc16179bf51f31f1e298dfd25cac90958abec52142d9ce17321f84c
Parent
205060d4b2b23c6…
2 files changed
+2
-2
+1
+2
-2
| --- src/content.c | ||
| +++ src/content.c | ||
| @@ -77,16 +77,16 @@ | ||
| 77 | 77 | ** This routines hands responsibility for the artifact over to the cache. |
| 78 | 78 | ** The cache will deallocate memory when it has finished with it. |
| 79 | 79 | */ |
| 80 | 80 | void content_cache_insert(int rid, Blob *pBlob){ |
| 81 | 81 | struct cacheLine *p; |
| 82 | - if( contentCache.n>500 || contentCache.szTotal>50000000 ){ | |
| 82 | + if( contentCache.n>2000 || contentCache.szTotal>256000000 ){ | |
| 83 | 83 | i64 szBefore; |
| 84 | 84 | do{ |
| 85 | 85 | szBefore = contentCache.szTotal; |
| 86 | 86 | content_cache_expire_oldest(); |
| 87 | - }while( contentCache.szTotal>50000000 && contentCache.szTotal<szBefore ); | |
| 87 | + }while( contentCache.szTotal>256000000 && contentCache.szTotal<szBefore ); | |
| 88 | 88 | } |
| 89 | 89 | if( contentCache.n>=contentCache.nAlloc ){ |
| 90 | 90 | contentCache.nAlloc = contentCache.nAlloc*2 + 10; |
| 91 | 91 | contentCache.a = fossil_realloc(contentCache.a, |
| 92 | 92 | contentCache.nAlloc*sizeof(contentCache.a[0])); |
| 93 | 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>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 |
M
src/db.c
+1
| --- src/db.c | ||
| +++ src/db.c | ||
| @@ -2761,10 +2761,11 @@ | ||
| 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 | + db_multi_exec("PRAGMA repository.cache_size=-32000"); | |
| 2766 | 2767 | sqlite3_file_control(g.db, "repository", SQLITE_FCNTL_DATA_VERSION, |
| 2767 | 2768 | &g.iRepoDataVers); |
| 2768 | 2769 | |
| 2769 | 2770 | /* Cache "allow-symlinks" option, because we'll need it on every stat call */ |
| 2770 | 2771 | g.allowSymlinks = db_get_boolean("allow-symlinks",0); |
| 2771 | 2772 |
| --- 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 |