Skip to content

performance of multidimensional array hashing #41880

Open
@michelangelo21

Description

Recently I discovered that hashing higher-dimensional arrays is faster when flatting them first.

using BenchmarkTools

@benchmark hash($rand(512)) # 8.072 μs
@benchmark hash($rand(8,8,8)) # 26.493 μs
@benchmark hash(vec($rand(8,8,8))) # 8.239 μs 

shouldn't arrays of primitive types have optimized methods for hash?

Activity

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

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions