Skip to content

Commit 6201ad4

Browse files
committed
Use mmap to read filters
1 parent d18ff83 commit 6201ad4

File tree

4 files changed

+13
-1
lines changed

4 files changed

+13
-1
lines changed

Cargo.lock

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

Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ hex = { version = "0.4", features = ["serde"] }
2121
http = "1"
2222
insta = { version = "1.44.3", features = ["filters"] }
2323
insta-cmd = "0.6.0"
24+
memmap2 = "0.9.9"
2425
reqwest = { version = "0.13", default-features = false, features = ["charset", "default-tls", "h2", "http2", "json"] }
2526
rand = "0.10"
2627
regex = "1.12"

upki/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ clap.workspace = true
1616
clubcard-crlite.workspace = true
1717
eyre.workspace = true
1818
hex.workspace = true
19+
memmap2.workspace = true
1920
reqwest.workspace = true
2021
rustls-pki-types.workspace = true
2122
rustls-webpki.workspace = true

upki/src/revocation/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ impl Manifest {
7474
let cache_dir = config.revocation_cache_dir();
7575
for f in &self.filters {
7676
let path = cache_dir.join(&f.filename);
77-
let bytes = match fs::read(&path) {
77+
let bytes = match File::open(&path).and_then(|f| unsafe { memmap2::Mmap::map(&f) }) {
7878
Ok(bytes) => bytes,
7979
Err(error) => {
8080
return Err(Error::FilterRead {

0 commit comments

Comments
 (0)