Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
This is an extension of #951838: Remove serialize() when it is not needed..
Is there any reason to handle object and header serialization in the module instead of passing it to APC? If not, getting rid of a couple lines of code allows APC to handle everything - headers and data.
IMO, the best reason for doing this is to use igbinary as APC's serialization handler.
Comment | File | Size | Author |
---|---|---|---|
#2 | 1235300-let_APC_serialize.patch | 2.08 KB | pounard |
use-APC-unserialize-for-everything.patch | 1.78 KB | rbayliss |
Comments
Comment #1
pounardSubscribe, I think this is the good way to go: you should use APC internals whenever possible, it will always be faster than PHP code itself.
Comment #2
pounardProvided patch wasn't applyable on the 7.x-1.x-dev git clone, fixed it.
The provided patch works great and do make my testing site a few millisec faster (beware of figures, it's highly environment dependent, but it works great for me).
Comment #3
R.Muilwijk CreditAttribution: R.Muilwijk commentedCommitted, thanks! http://drupalcode.org/project/apc.git/commit/ec46ec4
Comment #4
R.Muilwijk CreditAttribution: R.Muilwijk commentedComment #6
JGO CreditAttribution: JGO commentedwhat about igbinary serialization support? Wouldn't that be possible ? Or will it automatically with this patch if APC is enabled ?
Comment #7
R.Muilwijk CreditAttribution: R.Muilwijk commentedThis is not handled by the drupal apc module. We just pass on the variables to APC which serializes them internally.
Comment #8
pounardIf I remember correctly, APC uses PHP serialization mecanism to serialize stuff.
Comment #9
rbayliss CreditAttribution: rbayliss commentedAPC has it's own serialization setting, which is set in an INI file using the apc.serializer key. This issue was simply about removing all serialize/unserialize calls from the code, and allowing APC to use this serialization handler.
Example:
;Use igbinary as serializer in APC cache (3.1.7 or later)
apc.serializer=igbinary
Comment #10
pounardRight, I think I mistook it with memcached PHP extension which uses PHP built-in per default.