Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/pmmp/ext-libdeflate

PHP bindings for libdeflate, a zlib replacement with significantly better performance.
https://github.com/pmmp/ext-libdeflate

github-actions-enabled php-extension php80 php81 php82

Last synced: about 1 month ago
JSON representation

PHP bindings for libdeflate, a zlib replacement with significantly better performance.

Awesome Lists containing this project

README

        

# ext-libdeflate
[![CI](https://github.com/pmmp/ext-libdeflate/actions/workflows/ci.yml/badge.svg)](https://github.com/pmmp/ext-libdeflate/actions/workflows/ci.yml)

PHP bindings for [libdeflate](https://github.com/ebiggers/libdeflate), a zlib replacement with significantly better performance.

## Features
At the time of writing, this extension only exposes libdeflate's compression APIs, since these are the simplest to implement.

Since libdeflate doesn't support stream decompression, the decompression APIs are less useful unless you know the decompressed size of the data before decompressing it.

## Performance
Compared to `zlib_encode()`, a 40% performance improvement can be observed at level 1, rising to 50-70% at level 6 (default), for approximately the same compression ratios. Also, `libdeflate_deflate_compress()` was observed to sometimes be faster at level 6 compression than `zlib_encode()` at level 1 compression.

## API
```php