Skip to content

Commit

Permalink
Speed up reading metadata from file
Browse files Browse the repository at this point in the history
Added buffered read.
  • Loading branch information
argerus authored and SebastianSchildt committed Oct 21, 2024
1 parent 918f16a commit 81a15f1
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion databroker/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,8 @@ async fn read_metadata_file<'a, 'b>(
let path = filename.trim();
info!("Populating metadata from file '{}'", path);
let metadata_file = std::fs::OpenOptions::new().read(true).open(filename)?;
let entries = vss::parse_vss_from_reader(&metadata_file)?;
let buffered = std::io::BufReader::new(metadata_file);
let entries = vss::parse_vss_from_reader(buffered)?;

for (path, entry) in entries {
debug!("Adding VSS datapoint type {}", path);
Expand Down

0 comments on commit 81a15f1

Please sign in to comment.