Commit Graph

68 Commits

Author SHA1 Message Date
Rasmus Lerdorf 5833590296 zstd support (#539)
This adds zstd compression support.

The current two options, zlib and fastlz is basically a choice between performance and compression ratio.
You would choose zlib if you are memory-bound and fastlz if you are cpu-bound. With zstd, you get the
performance of fastlz with the compression of zlib. And often it wins on both. See this benchmark I ran
on json files of varying sizes: https://gist.github.com/rlerdorf/788f3d0144f9c5514d8fee9477cbe787

Taking just a 40k json blob, we see that zstd at compression level 3 reduces it to 8862 bytes. Our current
zlib 1 gets worse compression at 10091 bytes and takes longer both to compress and decompress.

      C Size  ratio%     C MB/s     D MB/s   SCORE      Name            File
        8037    19.9       0.58    2130.89       0.08   zstd 22         file-39.54k-json
        8204    20.3      31.85    2381.59       0.01   zstd 10         file-39.54k-json
        8371    20.7      47.52     547.12       0.01   zlib 9          file-39.54k-json
        8477    20.9      74.84     539.83       0.01   zlib 6          file-39.54k-json
        8862    21.9     449.86    2130.89       0.01   zstd 3          file-39.54k-json
        9171    22.7     554.62    2381.59       0.01   zstd 1          file-39.54k-json
       10091    24.9     153.94     481.99       0.01   zlib 1          file-39.54k-json
       10646    26.3      43.39    8097.40       0.01   lz4 16          file-39.54k-json
       10658    26.3      72.30    8097.40       0.01   lz4 10          file-39.54k-json
       13004    32.1    1396.10    6747.83       0.01   lz4 1           file-39.54k-json
       13321    32.9     440.08    1306.03       0.01   fastlz 2        file-39.54k-json
       14807    36.6     444.91    1156.77       0.01   fastlz 1        file-39.54k-json
       15517    38.3    1190.79    4048.70       0.02   zstd -10        file-39.54k-json

The fact that decompression a dramatically faster with zstd is a win for most common memcache uses
since they tend to be read-heavy. The PR also adds a `memcache.compression_level` INI switch which
currently only applies to zstd compression. It could probably be made to also apply to zlib and fastlz.
2023-04-27 08:32:10 -07:00
Aaron Stone 4a82c59f49 Document that --disable-x options are --enable-x 2018-12-21 04:44:15 -08:00
Michael D. Stemle, Jr 6220e207b0 In the latest zlib package for homebrew, the install target is /usr/local/opt/zlib, so I'm adding that to the list. (#410) 2018-11-14 16:25:58 -08:00
Peter Kokot f773f278c9 Replace obsolete AC_TRY_FOO with AC_FOO_IFELSE (#403)
Autoconf made several macros obsolete including the AC_TRY_COMPILE and
AC_TRY_LINK in 2000 and since Autoconf 2.50:
http://git.savannah.gnu.org/cgit/autoconf.git/tree/ChangeLog.2

These macros should be replaced with the current AC_FOO_IFELSE instead.

It is fairly safe to upgrade and take the recommendation advice of autoconf
upgrade manual since the upgrade should be compatible at least with PHP
versions 5.4 and up, on some systems even with PHP 5.3. PHP versions
from 5.4 to 7.1 require Autoconf 2.59+ and PHP 7.2+ require Autoconf
2.64+.

This patch was created with the help of autoupdate script.

Reference docs:
- https://www.gnu.org/software/autoconf/manual/autoconf-2.69/html_node/Obsolete-Macros.html
- https://www.gnu.org/software/autoconf/manual/autoconf-2.59/autoconf.pdf
2018-09-01 09:30:31 -07:00
Peter Kokot b70b82ee4a Remove forgotten unused comment about -lpthread (#406)
The -lpthread option has been added long time ago in commit
c10de3699f

and has been since also refactored and therefore comment is not needed
anymore:
feed35e220
2018-07-20 15:57:05 -07:00
Peter Kokot f5f84c592f Remove unused Git attributes ident (#402)
The $Id$ keywords were used in Subversion where they can be substituted
with filename, last revision number change, last changed date, and last
user who changed it.

In Git this functionality is different and can be done with Git attribute
ident. These need to be defined manually for each file in the
.gitattributes file and are afterwards replaced with 40-character
hexadecimal blob object name which is based only on the particular file
contents.

This patch simplifies handling of $Id$ keywords by removing them since
they are not used anymore.
2018-06-30 10:00:44 -07:00
Aaron Stone 5c6de2b0e4 Add support for libmemcached encryption (#381)
This feature is fully supported in libmemcached 1.0.18 and higher,
but has a notable bug in the original implementation in libmemcached
versions 1.0.6 - 1.0.17 that the encryption key, once set, cannot be
changed otherwise all further get/set operations fail.
2018-01-20 08:04:40 -08:00
Aaron Stone e622992e6f The configure script warns if libmemcached needs sasl.h if sasl.h cannot be found (#380) 2018-01-18 23:58:19 -08:00
Peter Kokot f30e7428e5 Fix typo bibrary to library (#372) 2017-12-05 09:13:23 -08:00
Aaron Stone fa620a48c4 Restore php_libmemcached_compat with workaround for missing memcached_exists (#314)
This partially reverts commit c564fd875e from #295
2017-02-07 12:34:07 +00:00
Frost Wong c3f90bcb59 correct a spelling mistake (#207) 2017-01-20 18:19:34 +00:00
Arjen c564fd875e Cleanup all checks for unsupported libmemcached versions (#295) 2017-01-20 13:26:57 +00:00
Mikko 7cb0c48c8d Fixes to session 2016-01-21 13:42:17 +00:00
Joe Watkins a24e439cb6 tidy configure stuff for json 2015-09-02 08:06:48 +01:00
Joe Watkins 2f5a5b06b1 woops 2015-09-01 21:25:01 +01:00
Joe Watkins ba37051ab2 fix json support 2015-09-01 20:45:47 +01:00
Anthony Ryan 7270cf3032 Fix a typo in the arguments help
Just noticed this when skimming through the code.
2014-09-28 01:01:56 -04:00
Remi Collet ada08ebfe0 allow to use system FastLZ 2014-09-05 19:42:54 +02:00
Mikko feed35e220 Version based tests: Do version checks in one place, fix check when setting options 2013-11-25 13:27:55 +08:00
Mikko 411a64fdcb Make config.m4 play nice when building inside the source tree 2013-11-24 15:21:11 +08:00
Mikko a437602912 Reorganise headers a bit, include everything in the private header 2013-11-24 13:48:52 +08:00
Mikko 6def3bbc92 Fix the message 2013-11-24 01:12:18 +08:00
Mikko 26ac8bd9cb Refactor SASL support checking, move "unnecessary" things to private header, move travis script to .travis dir 2013-11-24 00:00:59 +08:00
Mikko 65a8cf0c6a Improved config.m4, use pkg-config to find libmemcached 2013-11-19 16:01:32 +08:00
Mikko ff07307069 Merge branch 'master' of github.com:onethumb/php-memcached
Conflicts:
	config.m4
2013-11-18 17:15:42 +08:00
Mikko abe022c8cf Fail here 2013-11-18 12:05:01 +08:00
Mikko 853c0f1ba3 Fixes build for older libmemcached 2013-11-18 11:47:27 +08:00
Mikko 748566f5af Build fixes 2013-11-15 17:20:08 +08:00
Mikko 59a4c9551f proper builds for server 2013-11-15 16:44:34 +08:00
Mikko 5735f7f606 Added more server stuff, added examples of server 2013-11-15 04:29:44 +08:00
Mikko 1d5408b769 Starting initial work on server implementation 2013-11-14 15:44:19 +08:00
Mikko c10de3699f Fixed AC_TRY_COMPILE tests on CentOS 2013-10-21 15:54:44 +08:00
Mikko 47f6ff1060 Added support for libmemcached 0.44 and up. Testing for now 2013-10-19 00:35:46 +08:00
Mikko b5daa1da53 Push to start travis ci 2013-10-18 03:12:26 +08:00
Mikko 9812556e7a Fixed broken tests, fixed build against different libmemcached versions (hopefully) and misc error fixes 2013-10-18 03:10:22 +08:00
Don MacAskill 2ac3a9c390 Add msgpack serializer support for better cross-language binary serialization, fixed broken igbinary support 2013-01-10 17:22:07 -08:00
David Terei ace5771800 Enable SASL support by default if detected. 2013-01-04 00:02:06 +11:00
Andrei Zmievski 47172e18a1 Drop libmemcached 0.x series support, release 2.1.0. 2012-08-06 21:57:39 -07:00
Ilia Alshanetsky ef4a411074 Merge pull request #2 from couchbase/master
Make sasl disableable
2011-10-20 11:13:28 -07:00
Ilia Alshanetsky 55d57a3ef1 Fixed bug #59956 (Additional path to search for igbinary.h) 2011-10-17 16:19:33 -04:00
Jan Lehnardt db2fc7895f Make sasl disablable.
./configure --disable-memcached-sasl
2011-06-16 02:50:33 +02:00
Teddy Grenman df20b8a3c8 Convert float to ascii using g_fmt and zend_dtoa.
This procudes much smaller textual representations and also ignores
locales.
2011-05-03 01:33:15 +03:00
Mikko Koppanen a11099d4b0 AC_MSG_NOTICE is causing issues 2011-03-11 17:32:35 +00:00
Mikko Koppanen 3529c4d064 Add better error message when sasl headers are not found 2011-02-26 22:53:57 +00:00
Mikko Koppanen 4acdf084c5 Added SASL support 2011-02-25 14:33:51 +00:00
Ilia Alshanetsky 0399e8b59e Fixed incorrect fastlz directory creation 2011-01-17 05:21:19 -05:00
Mikko Koppanen ae7545e0b7 Update license to 3.01. Moved session handler support to separate files. clean up unused variables 2010-11-04 10:37:29 +00:00
Mikko Koppanen eb604a7241 Link zlib 2010-11-03 22:12:15 +00:00
Mikko Koppanen 122a4a2a0d Properly link with zlib 2010-11-03 21:07:27 +00:00
Mikko Koppanen 4d653e3cc3 fix zlib detection 2010-02-05 17:11:36 +00:00