/compression-library-benchmark

Compression Library Benchmark is a interactive web app to benchmark and compare popular JavaScript compression and serialization libraries.

Primary LanguageTypeScriptMIT LicenseMIT

Compression Library Benchmark πŸš€

Compression Library Benchmark is an interactive web app to benchmark and compare popular JavaScript compression and serialization libraries. Instantly see how FFLATE, Pako, LZString, CBOR, and MessagePack stack up on speed and compression using either a built-in 1MB payload or your own files.


✨ Features

  • ⚑ One-Click Benchmarking:
    Instantly compare multiple libraries.

  • πŸ“¦ Flexible Payloads:
    Use the default 1MB JSON or upload your own text file.

  • πŸ“Š Detailed Results Table:
    View original and compressed sizes (KB), encode/decode times (ms), total operation times, compression ratios, and size reductionβ€”all side by side.

  • πŸ‘€ Live Payload Preview:
    See your loaded payload and its size before benchmarking.


πŸ† Libraries Compared

🏷️ Library πŸ”Ž Description
FFLATE Fast, efficient DEFLATE/GZIP
Pako Popular zlib port for browsers
LZString Lightweight string compression
CBOR Concise Binary Object Representation
MessagePack Efficient binary serialization

πŸš€ Getting Started

  1. Clone the repo:

    git clone https://github.com/ChiragChrg/compression-library-benchmark.git
    cd compression-library-benchmark
  2. Install dependencies:

    npm install
  3. Run the app:

    npm run dev

    Open http://localhost:5173 in your browser.


πŸ“‚ Project Structure

.
β”œβ”€β”€ public/           # Static assets
β”œβ”€β”€ src/              # Source code
β”‚   β”œβ”€β”€ assets/       # Images and icons
β”‚   β”œβ”€β”€ utils/        # Utility functions
β”‚   β”œβ”€β”€ App.tsx       # Main app component
β”‚   └── main.tsx      # Entry point
β”œβ”€β”€ package.json      # Project metadata and scripts
β”œβ”€β”€ vite.config.ts    # Vite configuration
└── README.md         # This file

🀝 Contributing

Contributions, issues, and feature requests are welcome!
Whether you want to add new compression libraries, fix bugs, or improve the user experience, feel free to open an issue or submit a pull request.

Want to add a new compression library? Check out our detailed Contributing Guide for step-by-step instructions.


πŸ“„ License

This project is licensed under the MIT License.
You are free to use, modify, and share this project, as long as you include the original copyright.

Β© 2025 ChiragChrg β€” All rights reserved under MIT.