Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[HttpKernel] HttpCache Store cache key algorithm speed improvement #46893

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
pascalwoerde opened this issue Jul 9, 2022 · 1 comment · Fixed by #47094
Closed

[HttpKernel] HttpCache Store cache key algorithm speed improvement #46893

pascalwoerde opened this issue Jul 9, 2022 · 1 comment · Fixed by #47094

Comments

@pascalwoerde
Copy link
Contributor

Description

Description

The current store generates a sha256 cache key for every item. For a few requests this is fine. In particular when many requests are executed in a process, we can easily improve the total execution time by replacing this with a faster algorithm.

Possible Solution

https://github.com/symfony/http-kernel/blob/6.1/HttpCache/Store.php#L229

Replace sha256 with xxh3

Example

No response

@nicolas-grekas
Copy link
Member

Can you please send a PR? This should be used only when available of course (I didn't check its availability.)

@fabpot fabpot closed this as completed Aug 14, 2022
fabpot added a commit that referenced this issue Aug 14, 2022
…r http cache store key (Pascal Woerde)

This PR was squashed before being merged into the 6.2 branch.

Discussion
----------

[HttpKernel] Use xxh128 algorithm instead of sha256 for http cache store key

| Q             | A
| ------------- | ---
| Branch?       | 6.2
| Bug fix?      | no
| New feature?  | yes
| Deprecations? | no
| Tickets       | Fix #46893
| License       | MIT

Use xxh3 algorithm instead of sha256 for http cache store key. PR as requested in #46893

* Note that the xxHash support is available since PHP 8.1 as noted in the [change log](https://www.php.net/ChangeLog-8.php#PHP_8_1).

Commits
-------

0acc3ea [HttpKernel] Use xxh128 algorithm instead of sha256 for http cache store key
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants