Skip to content

[Performance] hash / sha256 #37440

Open
@Nuranto

Description

@Nuranto
Contributor

Summary

hash php native method is used at many places, using sha256 algorithm.

Since we dropped PHP7 support in latest versions of Magento, I suggest to change sha256 for xxh128 which is faster.

See : https://php.watch/versions/8.1/xxHash

Examples

I changed on my environment sha256 to xxh128 only in class RemoteSynchronizedCache class, here are the results :

Before : 33.4ms for hash execution (called 162 times)
After : less than 1ms for same number of calls

Proposed solution

No response

Release note

No response

Triage and priority

  • Severity: S0 - Affects critical data or functionality and leaves users without workaround.
    Severity: S1 - Affects critical data or functionality and forces users to employ a workaround.
    Severity: S2 - Affects non-critical data or functionality and forces users to employ a workaround.
    Severity: S3 - Affects non-critical data or functionality and does not force users to employ a workaround.
    Severity: S4 - Affects aesthetics, professional look and feel, “quality” or “usability”.

Activity

added
Triage: Dev.ExperienceIssue related to Developer Experience and needs help with Triage to Confirm or Reject it
on Apr 27, 2023
m2-assistant

m2-assistant commented on Apr 27, 2023

@m2-assistant

Hi @Nuranto. Thank you for your report.
To speed up processing of this issue, make sure that the issue is reproducible on the vanilla Magento instance following Steps to reproduce. To deploy vanilla Magento instance on our environment, Add a comment to the issue:


Join Magento Community Engineering Slack and ask your questions in #github channel.
⚠️ According to the Magento Contribution requirements, all issues must go through the Community Contributions Triage process. Community Contributions Triage is a public meeting.
🕙 You can find the schedule on the Magento Community Calendar page.
📞 The triage of issues happens in the queue order. If you want to speed up the delivery of your contribution, join the Community Contributions Triage session to discuss the appropriate ticket.

added
Priority: P2A defect with this priority could have functionality issues which are not to expectations.
on Apr 27, 2023
m2-assistant

m2-assistant commented on May 15, 2023

@m2-assistant

Hi @engcom-November. Thank you for working on this issue.
In order to make sure that issue has enough information and ready for development, please read and check the following instruction: 👇

  • 1. Verify that issue has all the required information. (Preconditions, Steps to reproduce, Expected result, Actual result).
    2. Verify that issue has a meaningful description and provides enough information to reproduce the issue.
    3. Add Area: XXXXX label to the ticket, indicating the functional areas it may be related to.
    4. Verify that the issue is reproducible on 2.4-develop branch
    Details- Add the comment @magento give me 2.4-develop instance to deploy test instance on Magento infrastructure.
    - If the issue is reproducible on 2.4-develop branch, please, add the label Reproduced on 2.4.x.
    - If the issue is not reproducible, add your comment that issue is not reproducible and close the issue and stop verification process here!
    5. Add label Issue: Confirmed once verification is complete.
    6. Make sure that automatic system confirms that report has been added to the backlog.
engcom-November

engcom-November commented on May 15, 2023

@engcom-November
Contributor

Hi @Nuranto ,
Thank you for reporting and collaboration. Currently Adobe commerce supports SHA256 but not xxh128 as per Magento documentation however this is a good feature to have and hence considering this as Feature request.
Thank you.

removed their assignment
on May 15, 2023
Nuranto

Nuranto commented on May 17, 2023

@Nuranto
ContributorAuthor

Thanks @engcom-November,

However note that this does not concern password hashing (or not only). sha256 hash are used in many other places (cf. given example of RemoteSynchronizedCache).

1 remaining item

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

Status

Pull Request in Progress

Milestone

No milestone

Relationships

None yet

    Participants

    @Nuranto@engcom-Bravo@engcom-November

    Issue actions

      [Performance] hash / sha256 · Issue #37440 · magento/magento2