Skip to content

Commit 415fd34

Browse files
hitalinclaude
andcommitted
perf: SQLite cache_size増量、ノートフェッチバッチ拡大
- SQLite cache_size: Writer -4000→-16000 (64MB)、Reader -2000→-8000 (32MB) TL表示・検索のディスクI/O待ち削減 - ポーリング時のノートフェッチバッチ: 3→8 リアクション更新の反映を高速化 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 9b5c256 commit 415fd34

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

src/db.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,12 +33,12 @@ const PRAGMAS_WRITER: &str = "\
3333
PRAGMA foreign_keys=ON;\
3434
PRAGMA synchronous=NORMAL;\
3535
PRAGMA mmap_size=268435456;\
36-
PRAGMA cache_size=-4000;\
36+
PRAGMA cache_size=-16000;\
3737
PRAGMA temp_store=MEMORY;";
3838

3939
const PRAGMAS_READER: &str = "\
4040
PRAGMA mmap_size=268435456;\
41-
PRAGMA cache_size=-2000;\
41+
PRAGMA cache_size=-8000;\
4242
PRAGMA temp_store=MEMORY;";
4343

4444
/// SQLite database with separate reader/writer connections.

src/streaming.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1221,8 +1221,8 @@ async fn polling_loop(
12211221
.unwrap_or_default()
12221222
};
12231223

1224-
// Fetch in batches of 3 to avoid overwhelming the server
1225-
for chunk in note_ids.chunks(3) {
1224+
// Fetch in batches of 8 to balance throughput vs server load
1225+
for chunk in note_ids.chunks(8) {
12261226
let futures: Vec<_> = chunk
12271227
.iter()
12281228
.map(|note_id| {

0 commit comments

Comments
 (0)