Skip to content

[Serializer] Add PSR-6 cache on $discriminatorCache #29878

@franek

Description

@franek

Description
@fbourigault has done a great job in order to Reduce class discriminator overhead with Symfony 4 (#28889). Nevertheless, it would be nice if $discriminatorCache implements PSR-6 cache. Cache will be populate on the first request and all other requests, will use the cache.

class ObjectNormalizer extends AbstractObjectNormalizer
{
    protected $propertyAccessor;

/** Replace array by a PSR-6 implementation */
    private $discriminatorCache = array();

    public function __construct(ClassMetadataFactoryInterface $classMetadataFactory = null, NameConverterInterface $nameConverter = null, PropertyAccessorInterface $propertyAccessor = null, PropertyTypeExtractorInterface $propertyTypeExtractor = null, ClassDiscriminatorResolverInterface $classDiscriminatorResolver = null)
    {
...
    }

Do you think it is a good idea to work on this feature ?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      pFad - Phonifier reborn

      Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

      Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


      Alternative Proxies:

      Alternative Proxy

      pFad Proxy

      pFad v3 Proxy

      pFad v4 Proxy