Code Monkey home page Code Monkey logo

tar_comparison's Introduction

Difference between Tar+gz with Rust libraries and system tar command

Run

$ git clone <url>
$ cd tar_comparison
$ cargo run --release

Read the output, all files generated are stored in a local tmp/ directory for inspection.

Expected

I expect that using compressing a directory with Rust libraries produces a similar sized file to cd <from-dir> && tar czf <to-filename.tar.gz> * (lower filesize is better).

Actual

## Comparing tar+gz at the same time using RUST and system

- RUST tar+gzip /Users/rschneeman/Documents/projects/tmp/tar_comparison/tmp/2024-06-06-17-32-23-327069000/rust_tar_gzip_one_operation.tar.gz
- Done
- System tar+gzip /Users/rschneeman/Documents/projects/tmp/tar_comparison/tmp/2024-06-06-17-32-23-327069000/system_tar_gzip_one_operation.tar.gz
  - Running tar+gzip command: "bash" "-c" "cd /Users/rschneeman/Documents/projects/tmp/tar_comparison/tmp/2024-06-06-17-32-23-327069000/source && tar -czf /Users/rschneeman/Documents/projects/tmp/tar_comparison/tmp/2024-06-06-17-32-23-327069000/system_tar_gzip_one_operation.tar.gz *"
  - stdout:
  - stderr:
  - tar+gzip command succeeded
- Done
 - system_tar_gz size: 21337548
 - rust_tar_gz size: 40482499

## system_tar_gz is smaller than rust_tar_gz (tar+gzip)
 :(

Shelling out to tar -czf produces a file that is 0.525x the size as using Rust + Gzip in an atomic operation.

tar_comparison's People

Contributors

schneems avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.