-
Notifications
You must be signed in to change notification settings - Fork 326
Added msgpack serializer support #55
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…lization, fixed broken igbinary support
I left igbinary as the default if it's enabled, but personally think msgpack would be a saner default if it's enabled given the broader adoption, space savings, etc. Your call. :) |
Would be great to have this merged |
; | ||
; The default is igbinary if available and php otherwise. | ||
; The default is igbinary if available, then msgpack if available, then php otherwise. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Probably need to double-check all the use cases for serialization, make sure msgpack handles them well. I seem to recall some bumps using JSON encoding certain types of objects (maybe just ones with binary contents?)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you write some tests for the use-cases?
Time to merge this in, ey? |
I haven't yet looked at this, let me review. (First glance, don't see any tests) |
#ifdef HAVE_MEMCACHED_MSGPACK | ||
case SERIALIZER_MSGPACK: | ||
php_msgpack_serialize(&buf, value TSRMLS_CC); | ||
if(!buf.c) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Spaces for indentation?
Added some comments |
Can someone write a few tests for this PR? |
See onethumb#1 ... |
looks good. If @onethumb can merge that to his I'll merge this PR in one go. |
Added tests and fixes whitespaces
Ready to merge. |
There is a small issue with msgpack extension. See issue 23 in php-msgpack repo. I'll wait for the response for that to know what to with tests. On super slow edge connection but I'll merge this in the morning at the office. |
Merged msgpack support, this wouldn't merge so had to do some changes. I'll merge the test manually. Thanks guys, and sorry for the wait! |
We needed a better compact, binary serializer for memcached that worked across non-PHP languages. msgpack has proven to be very fast and compact and results in significant savings.
See: http://msgpack.org/ & https://github.com/msgpack/msgpack-php/
While I was in there, I fixed the igbinary support, which silently said it was working but actually fell back to the default for serialization due to a typo (MEMCACHE instead of MEMCACHED). :)