Skip to content

Replace the hash function used in YJIT with a faster implementation #561

Closed
@whtsht

Description

@whtsht

Issue description:

Replace the hash function used in YJIT from the default SipHash in the standard library to a faster alternative.

Motivation:

YJIT currently uses HashMap and HashSet from the standard library, which utilize SipHash by default. While SipHash is collision-resistant, it is relatively slow. Replacing it with a faster hash function, even at the cost of reduced collision resistance, may improve performance.

Task:

Concerns:

Switching to a faster, non-collision-resistant hash function may increase the risk of hash flooding attacks. To mitigate this, careful implementation and random seeding will be required.

For example, Node.js faced a hash flooding vulnerability in the past: https://v8.dev/blog/hash-flooding.

Conclusion:

I welcome feedback, especially regarding potential security concerns or implementation suggestions. Thank you.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions