Skip to content

Pull lazily on read for read-your-writes#2109

Merged
levydsa merged 2 commits intotursodatabase:mainfrom
levydsa:pull-on-read
Jun 27, 2025
Merged

Pull lazily on read for read-your-writes#2109
levydsa merged 2 commits intotursodatabase:mainfrom
levydsa:pull-on-read

Conversation

@levydsa
Copy link
Copy Markdown
Contributor

@levydsa levydsa commented Jun 24, 2025

#2105

Before:

$ hyperfine target/debug/libsql-probe
Benchmark 1: target/debug/libsql-probe
  Time (mean ± σ):     11.488 s ±  3.327 s    [User: 0.367 s, System: 0.111 s]
  Range (min … max):    6.270 s … 17.406 s    10 runs

After:

$ hyperfine target/debug/libsql-probe
Benchmark 1: target/debug/libsql-probe
  Time (mean ± σ):      3.156 s ±  1.063 s    [User: 0.406 s, System: 0.066 s]
  Range (min … max):    1.764 s …  5.268 s    10 runs

On this kind of workload, running the server locally:

for i in 0..100 {
    conn.execute("insert into test values (?)", libsql::params!(i)).await?;
}

let mut rows = conn.query("select * from test", ()).await?;

@levydsa levydsa marked this pull request as ready for review June 24, 2025 18:15
@penberg penberg changed the title Pull on read Pull lazily on read for read-your-writes Jun 26, 2025
@penberg penberg added this pull request to the merge queue Jun 26, 2025
@penberg penberg removed this pull request from the merge queue due to a manual request Jun 26, 2025
@levydsa levydsa added this pull request to the merge queue Jun 27, 2025
Merged via the queue into tursodatabase:main with commit 9cbba77 Jun 27, 2025
18 of 19 checks passed
@levydsa levydsa deleted the pull-on-read branch June 27, 2025 14:14
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.

2 participants