Couchbase
  • Why NoSQL?
  • Couchbase Server
  • Download
  • Resources
  • Careers
Home | Forums | SDKs | SDKs

PHP Client lib use igbinary - if not can it?

2 replies [Last post]
  • Login or register to post comments
Thu, 12/27/2012 - 16:01
rynop
Offline
Joined: 09/15/2011
Groups: None

igbinary is pretty sweet. PHP 1.1 client use it? if not I'd like to request it as a feature. https://github.com/php-memcached-dev/php-memcached uses it today.

https://github.com/igbinary/igbinary/ explains it better than I can:

Igbinary is a drop in replacement for the standard php serializer. Instead of
time and space consuming textual representation, igbinary stores php data
structures in compact binary form. Savings are significant when using
memcached or similar memory based storages for serialized data. About 50%
reduction in storage requirement can be expected. Specific number depends on
your data.

Unserialization performance is at least on par with the standard PHP serializer.
Serialization performance depends on the "compact_strings" option which enables
duplicate string tracking. String are inserted to a hash table which adds some
overhead. In usual scenarios this does not have much significance since usage
pattern is "serialize rarely, unserialize often". With "compact_strings"
option igbinary is usually a bit slower than the standard serializer. Without
it, a bit faster.

Top
  • Login or register to post comments
Thu, 12/27/2012 - 17:14
ingenthr
Offline
Joined: 03/16/2010
Groups:

We have this as a planned improvement, but it's not planned in the near term as you can see in PCBC-33. Of course, any code contributions are gladly accepted.

Is it possible to use igbinary independently of the library?  Making this a configure time option doesn't seem so nice, and when we looked into it part of the problem was environment availablility of igbinary support.

Top
  • Login or register to post comments
Fri, 12/28/2012 - 07:29
rynop
Offline
Joined: 09/15/2011
Groups: None

Not quite sure what you mean by "Is it possible to use igbinary independently of the library". I'm not quite sure to be honest - ./configure --enable-memcached-igbinary is the only way I've ever done it. I know with the so you'll have access to igbinary_serialize() and igbinary_unserialize() from PHP code scope, but I think for perf reasons you'd want in in your couchbase sdk .so.

However, its super simple to install. igbinary exists in the PECL repo - so its a pecl install igbinary to get the igbinary.so. http://stackoverflow.com/questions/6830260/how-to-enable-igbinary-with-m... is something I wrote up that shows end-to-end, its really pretty easy - and something you guys could script into the makefile a PECL build of the couchbase sdk so (I think).

Do you have a PECL repo entry BTW? I couldn't find one. Much easier for people to maintain vs d/l so or building the so. Would allow you to leverage getcomposer.org/ too.

As for contributing if/when I use couchbase 2.0 I'll look into doing that. Havnen't written c/++ for long time tho.

Top
  • Login or register to post comments
  • Login or register to post comments
  • Login
  • Register

Company

  • About Us
  • Leadership
  • Customers
  • Partners
  • Contact Us

Product

  • Couchbase Server
  • Couchbase SDKs
  • Use Cases
  • Documentation
  • Forums

Open Source

  • Couchbase Project
  • Couchbase vs. CouchDB

Commercial

  • Subscriptions & Support
  • Training & Services

News

  • Blog
  • Newsletter
  • Press Releases
  • Buzz

Follow Us

    
  • Customer Login
  • Terms of Service
  • Privacy Policy
  • Trademark Policy
  • Site Map

© 2013 COUCHBASE All rights reserved.

Sign in to Couchbase Community

close
  • Create new account
  • Request new password
You are logging into the Forums, Wiki and Issue Tracker