Skip to content

Conversation

@frisitano
Copy link
Collaborator

@frisitano frisitano commented Oct 22, 2025

Overview

Updates the database configuration to be more performant

https://sqlite.org/pragma.html

@frisitano frisitano requested a review from greged93 October 22, 2025 13:43
Copy link
Collaborator

@greged93 greged93 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

feel free to merge

const ACQUIRE_TIMEOUT_SECS: u64 = 5;

/// The cache size in KB
const CACHE_SIZE_KB: &str = "-131072"; // 128 MB
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this a typo?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you mean the variable name?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the dash in front of 131072

Copy link
Collaborator Author

@frisitano frisitano Oct 22, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ahhh no, positive numbers specify number of pages, negative numbers specify the size in KB:

If the argument N is positive then the suggested cache size is set to N. If the argument N is negative, then the number of cache pages is adjusted to be a number of pages that would use approximately abs(N*1024) bytes of memory based on the current page size. SQLite remembers the number of pages in the page cache, not the amount of memory used. So if you set the cache size using a negative number and subsequently change the page size (using the PRAGMA page_size command) then the maximum amount of cache memory will go up or down in proportion to the change in page size.

@codspeed-hq
Copy link

codspeed-hq bot commented Oct 22, 2025

CodSpeed Performance Report

Merging #385 will improve performances by 13.73%

Comparing feat/database-config (8d45c4c) with main (59cb712)

Summary

⚡ 1 improvement
✅ 1 untouched

Benchmarks breakdown

Benchmark BASE HEAD Change
pipeline_derive_s3_blobs 75.1 ms 66.1 ms +13.73%

@frisitano frisitano merged commit f0c0fe7 into main Oct 22, 2025
14 of 15 checks passed
@frisitano frisitano deleted the feat/database-config branch October 22, 2025 13:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants