Code Monkey home page Code Monkey logo

em_inflate's Introduction

em_inflate -- Fast, in-memory, single file decompressor for zlib, deflate and gzip

em_inflate is a one-file, single function call, memory-to-memory decompressor for the zlib, deflate and gzip bitstream formats:

RFC 1950: ZLIB specification

RFC 1951: DEFLATE specification

RFC 1952: GZIP specification

You just need to add em_inflate.c and em_inflate.h to your project and call em_inflate() to decompress some data.

em_inflate is less than 1,200 lines of C (including 300 lines of two different flavors of checksums), and decompresses faster than zlib.

enwik8 decompression (gzip bitstream, 100,000,000 bytes compressed to 36,445,248 with gzip -9):

Decompressor                      Time (microseconds), core i7
zlib inflate 1.2.11               426,167 (100%)
em_inflate (verify checksum)      358,118 (84%)
em_inflate (skip checksum)        275,847 (64%)

large raw texture decompression (zlib bitstream, 32,212,992 bytes compressed to 13,721,537 with gzip -9):

Decompressor                      Time (microseconds), core i7
zlib inflate 1.2.11               127,945 (100%)
em_inflate (verify checksum)      114,369 (89%)
em_inflate (skip checksum)        105,476 (82%)

Code size (linux x86_64, clang 6.0.0 -O3, most of the rodata is checksum tables)

With checksums                    10,334 (code) + 4,624 (rodata)  14,958
Without checksums                 8,510 (code) + 518 (rodata)     9,028

em_inflate is developed by Emmanuel Marty. gzip crc32 checksum by Stephen Brumme. adler checksum computation by Mark Adler. All code is licensed under the zlib license, with the gzip crc32 code under a zlib-like license. All mentions are included in the sourcecode.

em_inflate's People

Contributors

emmanuel-marty 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.