Files
turso/core/Cargo.toml
Pekka Enberg 02023ce821 Merge 'core/storage: Switch page cache queue to linked list' from Pekka Enberg
The page cache implementation uses a pre-allocated vector (`entries`)
with fixed capacity, along with a custom hash map and freelist. This
design requires expensive upfront allocation when creating a new
connection, which severely impacted performance in workloads that open
many short-lived connections (e.g., our concurrent write benchmarks that
create a new connection per transaction).
Therefore, replace the pre-allocated vector with an intrusive doubly-
linked list. This eliminates the page cache initialization overhead from
connection establishment, but also reduces memory usage to entries that
are actually used. Furthermore, the approach allows us to grow the page
cache with much less overhead.
The patch improves concurrent write throughput benchmark by 4x for
single-threaded performance.
Before:
```
$ write-throughput --threads 1 --batch-size 100 -i 1000 --mode concurrent
Running write throughput benchmark with 1 threads, 100 batch size, 1000 iterations, mode: Concurrent
Database created at: write_throughput_test.db
Thread 0: 100000 inserts in 3.82s (26173.63 inserts/sec)
```
After:
```
$ write-throughput --threads 1 --batch-size 100 -i 1000 --mode concurrent
Running write throughput benchmark with 1 threads, 100 batch size, 1000 iterations, mode: Concurrent
Database created at: write_throughput_test.db
Thread 0: 100000 inserts in 0.90s (110848.46 inserts/sec)
```

Closes #3456
2025-10-01 16:39:47 +03:00

127 lines
3.4 KiB
TOML

# Copyright 2023-2025 the Turso authors. All rights reserved. MIT license.
[package]
name = "turso_core"
version.workspace = true
authors.workspace = true
edition.workspace = true
license.workspace = true
repository.workspace = true
description = "The Turso database library"
[lib]
name = "turso_core"
path = "lib.rs"
[features]
default = ["fs", "uuid", "time", "json", "series", "encryption"]
antithesis = ["dep:antithesis_sdk"]
tracing_release = ["tracing/release_max_level_info"]
conn_raw_api = []
fs = ["turso_ext/vfs"]
json = []
uuid = ["dep:uuid"]
io_uring = ["dep:io-uring", "rustix/io_uring"]
time = []
fuzz = []
omit_autovacuum = []
simulator = ["fuzz", "serde"]
serde = ["dep:serde"]
series = []
encryption = []
checksum = []
cli_only = []
test_helper = []
[target.'cfg(target_os = "linux")'.dependencies]
io-uring = { version = "0.7.5", optional = true }
libc = { version = "0.2.172" }
[target.'cfg(target_family = "unix")'.dependencies]
polling = "3.7.4"
rustix = { version = "1.0.5", features = ["fs"] }
libc = { version = "0.2.172" }
[target.'cfg(not(target_family = "wasm"))'.dependencies]
libloading = "0.8.6"
[dependencies]
antithesis_sdk = { workspace = true, optional = true }
turso_ext = { workspace = true, features = ["core_only"] }
cfg_block = "0.1.1"
fallible-iterator = { workspace = true }
hex = { workspace = true }
thiserror = { workspace = true }
getrandom = { version = "0.2.15" }
regex = { workspace = true }
regex-syntax = { workspace = true, default-features = false, features = [
"unicode",
] }
chrono = { workspace = true, default-features = false, features = ["clock"] }
julian_day_converter = "0.4.5"
rand = "0.8.5"
libm = "0.2"
turso_macros = { workspace = true }
miette = { workspace = true }
strum = { workspace = true }
parking_lot = { workspace = true }
crossbeam-skiplist = "0.1.3"
tracing = { workspace = true }
ryu = "1.0.19"
uncased = "0.9.10"
strum_macros = { workspace = true }
bitflags = { workspace = true }
serde = { workspace = true, optional = true, features = ["derive"] }
paste = "1.0.15"
uuid = { version = "1.11.0", features = ["v4", "v5", "v7"], optional = true }
tempfile = { workspace = true }
pack1 = { version = "1.0.0", features = ["bytemuck"] }
bytemuck = "1.23.1"
aes-gcm = { version = "0.10.3"}
aes = { version = "0.8.4"}
turso_parser = { workspace = true }
aegis = "0.9.0"
twox-hash = "2.1.1"
intrusive-collections = "0.9.7"
[build-dependencies]
chrono = { workspace = true, default-features = false }
built = { version = "0.7.5", features = ["git2", "chrono"] }
[target.'cfg(not(target_family = "windows"))'.dev-dependencies]
pprof = { version = "0.14.0", features = ["criterion", "flamegraph"] }
[dev-dependencies]
memory-stats = "1.2.0"
criterion = { workspace = true, features = [
"html_reports",
"async",
"async_futures",
] }
rstest = "0.18.2"
rusqlite.workspace = true
quickcheck = { version = "1.0", default-features = false }
quickcheck_macros = { version = "1.0", default-features = false }
rand = "0.8.5" # Required for quickcheck
rand_chacha = { workspace = true }
env_logger = { workspace = true }
test-log = { version = "0.2.17", features = ["trace"] }
sorted-vec = "0.8.6"
mimalloc = { workspace = true, default-features = false }
[[bench]]
name = "benchmark"
harness = false
[[bench]]
name = "mvcc_benchmark"
harness = false
[[bench]]
name = "json_benchmark"
harness = false
[[bench]]
name = "tpc_h_benchmark"
harness = false