Open TysonAndre opened 1 year ago
I didn't see https://github.com/krakjoe/apcu/pull/431 , which is related to this issue
+1
This is a tricky issue and often overlooked, especially when building PHP and extensions from code.
What about changing the default value of ini to default
and removing php
? This involves a BC Break, but since my warning about specifying an unsupported serializer is a BC Break as well, it seems appropriate to fix it in the next release.
https://pecl.php.net/package-changelog.php?package=APCu&release=5.1.22 - I looked into this more today. I assume that the changes in 5.1.20 likely would have fixed the bugs that were encounted with apc.serializer=default
(though I'm still not certain). It looks like the current approach shouldn't have bugs (though one fix for php 8.2 is not yet released).
What about changing the default value of ini to
default
and removingphp
? This involves a BC Break, but since my warning about specifying an unsupported serializer is a BC Break as well, it seems appropriate to fix it in the next release.
There are use cases where default
would have better performance (but higher memory) compared to php unserialize(), e.g. unserializing values containing many small arrays. There are also use cases where php
has better performance, and php
has lower memory than default
in most cases (default can be better when values in arrays are reused)
https://github.com/krakjoe/apcu/pull/454#issue-1419890666 see comparison of apc.serializer=default
and apc.serializer=php
for small arrays
https://github.com/krakjoe/apcu/issues/323 - since I mentioned performance, there's still room for improvement for the serializer=default
performance with optimizations that can be done but just aren't implemented yet
Thanks. I had overlooked it!
https://github.com/krakjoe/apcu/blob/98b26169d4145fef67df9e54e28f8af0720a5cdf/apc_persist.c#L428-L451
The "default" serializer is the absence of a serializer (affects apcu's behavior for arrays of non-objects) and there's no string entry for "default", it corresponds to a null pointer for
apc_serializer_t *serializer
(serializer=0x0)i.e. there's no such thing as APC_SERIALIZER_NAME(default) or APC_UNSERIALIZER_NAME(default)
Observed: When apcu fails to find a serializer, it uses a null pointer (equivalent to apc.serializer=default) without emitting a warning about the serializer name being unrecognized Expected: Consider defaulting to "php" (the actual default) instead if a serializer is unrecognized or not loaded (e.g. igbinary not loaded)