Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Performance delta when compared to Squashfs-tools:unsquashfs #503

@bryangarza

Description

@bryangarza

Hi, recently I've been trying out backhand out to extract a large archive. But it seems like there is a big slowdown during the loading of the file into memory, specifically, this line seems to hang multiple minutes:

let filesystem = archive.into_filesystem_reader()?;

API link

Reproduction steps:

  1. Clone https://github.com/rust-lang/crates.io-index and use mksquashfs to create an archive.
  2. Extract using backhand-cli's unsquashfs
  3. Extract using squashfs-tools's unsquashfs implementation

Here's a comparison on my machine:

unsquashfs-backhand 247.92s user 21.23s system 111% cpu 4:01.51 total
VS
Squashfs-tools:unsquashfs 1.66s user 7.40s system 163% cpu 5.546 total

And finally, to check just loading the archive but not extracting it, I tried just running --list on the same archive, and it takes almost 3 minutes:

unsquashfs-backhand crates-io.squashfs --list  171.10s user 0.98s system 100% cpu 2:52.07 total

This is on x86_64 linux.


Additional notes:
I initially noticed this when I was using the regular backhand APIs to write my own extraction code, but once I ran into the performance issue, I switched to testing backhand-cli's reference implementation to see if maybe the reason for the slowdown was caused by my own code.

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-questionFurther information is requested

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions