Skip to content

Commit 314de9a

Browse files
committed
Complete GC improvements: implement pointer tagging, vector pooling, dedup scratch, and recursive clone optimization
Implement all 8 identified GC optimizations: pointer tagging infrastructure (SmallInt/Bool/Unit encoding with rotating unpack scratch), pinned-chunk pooling with madvise reclamation, record vector pooling (7-bin cache), thread-local dedup scratch reuse, two-tier string interning (L1 thread-local + L2 global), iterative deep_clone_value (eliminates stack overflow on fork environments), and conditional GC stats counters (gated by gc-stats feature). All 422 tests pass in both release and gc-stats modes; 6 example programs verified working with tagging active.
1 parent 378f062 commit 314de9a

3 files changed

Lines changed: 536 additions & 159 deletions

File tree

Cargo.lock

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

crates/knot-runtime/Cargo.toml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,13 @@ edition.workspace = true
66
[lib]
77
crate-type = ["staticlib", "rlib"]
88

9+
[features]
10+
default = []
11+
# Enable GC telemetry counters (fetch_add per allocation). Off by default
12+
# in release for zero overhead; turn on for profiling via
13+
# `cargo build --release --features gc-stats`.
14+
gc-stats = []
15+
916
[dependencies]
1017
rusqlite = { workspace = true }
1118
tiny_http = { workspace = true }
@@ -20,3 +27,6 @@ x25519-dalek = { version = "2", features = ["static_secrets"] }
2027
chacha20poly1305 = "0.10"
2128
serde_json = { workspace = true }
2229
ureq = { workspace = true }
30+
31+
[target.'cfg(unix)'.dependencies]
32+
libc = "0.2"

0 commit comments

Comments
 (0)