[TASK] Eliminate double serialization in ApcuBackend
APCu can store arbitrary PHP data; it serializes all values when they are stored, and it has a pluggable serializer interface which can use serializers that are better than serialize(), such as "igbinary", see [1] and [2]. By not implementing TransientBackendInterface, the ApcuBackend forces class VariableFrontend to serialize all values into a string, but APCu serializes the string again. This adds TransientBackendInterface and removes the is_string() check. Double serialization is eliminated by this change. Additionally, the unit tests are turned into functionals, the backend is declared final, gets some more type hints and uses the quicker xxh3 hash. [1] https://www.php.net/manual/en/book.igbinary.php [2] https://pecl.php.net/package/igbinary Releases: main Resolves: #99851 Change-Id: I8663deefd1ffeb249376119287191bcec9ef2420 Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/77717 Tested-by:Christian Kuhn <lolli@schwarzbu.ch> Tested-by:
Stefan Bürk <stefan@buerk.tech> Reviewed-by:
Christian Kuhn <lolli@schwarzbu.ch> Tested-by:
core-ci <typo3@b13.com> Reviewed-by:
Stefan Bürk <stefan@buerk.tech>
Showing
- composer.json 1 addition, 0 deletionscomposer.json
- typo3/sysext/core/Classes/Cache/Backend/ApcuBackend.php 48 additions, 83 deletionstypo3/sysext/core/Classes/Cache/Backend/ApcuBackend.php
- typo3/sysext/core/Tests/Functional/Cache/Backend/ApcuBackendTest.php 71 additions, 51 deletions...t/core/Tests/Functional/Cache/Backend/ApcuBackendTest.php
- typo3/sysext/core/Tests/Functional/Cache/Backend/RedisBackendTest.php 1 addition, 2 deletions.../core/Tests/Functional/Cache/Backend/RedisBackendTest.php
- typo3/sysext/core/composer.json 1 addition, 0 deletionstypo3/sysext/core/composer.json
Please register or sign in to comment