Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

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

License

NotificationsYou must be signed in to change notification settings

pmmp/ext-libdeflate

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

36 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CI

PHP bindings forlibdeflate, 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 tozlib_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 thanzlib_encode() at level 1 compression.

API

<?php/** * Equivalent to zlib_encode($data, ZLIB_ENCODING_RAW, $level) * @throws \RuntimeException */function libdeflate_deflate_compress(string$data,int$level =6) :string;/** * Equivalent to zlib_encode($data, ZLIB_ENCODING_DEFLATE, $level) * @throws \RuntimeException */function libdeflate_zlib_compress(string$data,int$level =6) :string;/** * Equivalent to zlib_encode($data, ZLIB_ENCODING_GZIP, $level) * @throws \RuntimeException */function libdeflate_gzip_compress(string$data,int$level =6) :string;

[8]ページ先頭

©2009-2025 Movatter.jp