-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathCargo.toml
More file actions
193 lines (171 loc) · 4.28 KB
/
Cargo.toml
File metadata and controls
193 lines (171 loc) · 4.28 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
[workspace]
members = [".", "bench-support"]
resolver = "2"
[package]
name = "cachekit"
version = "0.8.0"
edition = "2024"
rust-version = "1.85"
authors = ["Thomas Korrison <ferrite.db@gmail.com>"]
license = "MIT OR Apache-2.0"
description = "High-performance cache primitives with pluggable eviction policies (LRU, LFU, FIFO, 2Q, Clock-PRO, S3-FIFO) and optional metrics."
homepage = "https://oxidizelabs.github.io/cachekit/"
repository = "https://github.com/OxidizeLabs/cachekit"
readme = "README.md"
keywords = ["cache", "lru", "lfu", "eviction", "s3-fifo"]
categories = ["caching", "data-structures"]
exclude = ["/.idea/", "/.DS_Store", "/**/.DS_Store"]
[package.metadata.docs.rs]
all-features = true
rustdoc-args = ["--cfg", "docsrs"]
targets = ["x86_64-unknown-linux-gnu"]
[lib]
name = "cachekit"
path = "src/lib.rs"
test = true
doctest = true
bench = true
doc = true
crate-type = ["lib"]
[features]
default = ["policy-s3-fifo", "policy-lru", "policy-fast-lru", "policy-lru-k", "policy-clock"]
metrics = []
serde = ["dep:serde"]
concurrency = ["parking_lot"]
# Eviction policy feature flags. Enable only the policies you need for smaller builds.
# Use `default-features = false` and select specific policies, or use `policy-all` for every policy.
policy-all = [
"policy-fifo",
"policy-lru",
"policy-fast-lru",
"policy-lru-k",
"policy-lfu",
"policy-heap-lfu",
"policy-two-q",
"policy-s3-fifo",
"policy-arc",
"policy-car",
"policy-lifo",
"policy-mfu",
"policy-mru",
"policy-random",
"policy-slru",
"policy-clock",
"policy-clock-pro",
"policy-nru",
]
policy-fifo = []
policy-lru = []
policy-fast-lru = []
policy-lru-k = []
policy-lfu = []
policy-heap-lfu = []
policy-two-q = []
policy-s3-fifo = []
policy-arc = []
policy-car = []
policy-lifo = []
policy-mfu = []
policy-mru = []
policy-random = []
policy-slru = []
policy-clock = []
policy-clock-pro = []
policy-nru = []
[dependencies]
parking_lot = { version = "0.12", optional = true }
rustc-hash = "2.1"
serde = { version = "1", features = ["derive"], optional = true }
siphasher = "1"
[dev-dependencies]
bench-support = { path = "bench-support" }
criterion = "0.8"
dhat = "0.3"
lru = "0.17"
quick_cache = "0.6"
serde_json = "1.0"
chrono = "0.4"
proptest = "1.11"
arbitrary = { version = "1.4", features = ["derive"] }
# =============================================================================
# Benchmarks - organized by purpose
# =============================================================================
# Cross-policy workload comparison (single source of truth)
[[bench]]
name = "workloads"
harness = false
# Micro-operations (get/insert latency for all policies)
[[bench]]
name = "ops"
harness = false
# External crate comparison (lru, quick_cache)
[[bench]]
name = "comparison"
harness = false
# Human-readable reports (not criterion, just prints tables)
[[bench]]
name = "reports"
harness = false
# JSON artifact runner (produces target/benchmarks/<run-id>/results.json)
[[bench]]
name = "runner"
harness = false
# DHAT heap profiling (writes dhat-heap.json in cwd)
[[bench]]
name = "dhat_profile"
harness = false
# Policy-specific unique operations
[[bench]]
name = "policy_lru"
path = "benches/policy/lru.rs"
harness = false
[[bench]]
name = "policy_lfu"
path = "benches/policy/lfu.rs"
harness = false
[[bench]]
name = "policy_lru_k"
path = "benches/policy/lru_k.rs"
harness = false
[[bench]]
name = "policy_s3_fifo"
path = "benches/policy/s3_fifo.rs"
harness = false
# Development profile - optimized for fast compilation and good debugging
[profile.dev]
opt-level = 0
debug = true
debug-assertions = true
overflow-checks = true
lto = false
panic = "unwind"
incremental = true
codegen-units = 256
# Test profile - balanced for test execution speed vs debugging
[profile.test]
opt-level = 1
debug = true
debug-assertions = true
overflow-checks = true
lto = false
incremental = true
codegen-units = 256
# Release profile - maximum performance for production
[profile.release]
opt-level = 3
debug = false
debug-assertions = false
overflow-checks = false
lto = "fat"
panic = "abort"
codegen-units = 1
strip = true
# Benchmark profile - optimized for consistent performance measurement
[profile.bench]
opt-level = 3
debug = false
debug-assertions = false
overflow-checks = false
lto = "thin"
codegen-units = 1
strip = true