Skip to content

cache type descriptors and media types#145

Merged
dgafka merged 2 commits intoecotoneframework:mainfrom
jlabedo:cache-type-descriptors
Jun 9, 2023
Merged

cache type descriptors and media types#145
dgafka merged 2 commits intoecotoneframework:mainfrom
jlabedo:cache-type-descriptors

Conversation

@jlabedo
Copy link
Contributor

@jlabedo jlabedo commented Jun 9, 2023

No description provided.


private const TYPE_PARAMETER = 'type';

private static array $parsedMediaTypes = [];
Copy link
Member

@dgafka dgafka Jun 9, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is using enum having the same effect or enums are always new instances?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How would you use enum in this case ?

The goal is mainly to avoid parsing the media type again and again, as it is called a lot of times for a single message

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would not, just curious :P

@dgafka
Copy link
Member

dgafka commented Jun 9, 2023

That benchmark did the job. I could clearly see how huge impact this PR has. On average it's around 15% boost 🥇

@dgafka dgafka merged commit 42e9a08 into ecotoneframework:main Jun 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants