Open marxin opened 3 months ago
rpm::rpm::headers::header::Header::parse_signature
is calling .push() for every single signature byte;IndexData::Bin
handling should be rewritten to avoid nom. It can just get the slice and put it intobin
with one call toextend_from_slice
. For example like this:let bin_bytes = remaining.get(..num_items as usize).ok_or_else(|| Error::Nom("Insufficient bytes for IndexData::Bin entry".into()))?; bin.extend_from_slice(bin_bytes);
Good catch! I've just addressed that in #235.
- This line inside
get_file_paths
does two allocations:acc.push(PathBuf::from(dir).join(basename));
. It might be more efficient to dolet mut path = PathBuf::from(dir); path.push(basename); acc.push(path);
Yes, that really helps and it's addressed in #237.
The following great optimization hints were destined as a part of the discussion in https://github.com/mstange/samply/issues/290: