Skip to content

Consider memoizing TupleStruct#hash #309

@neilconway

Description

@neilconway

We spend a reasonable amount of time computing and recomputing the hash value of TupleStructs. At the expense of some memory (~4 bytes per tuple), we could memoize and cache the result of TupleStruct#hash. On a quick join benchmark (test/perf/join_bench.rb), this improves performance by about 10%.

It only works when tuples are immutable, but they probably should be anyway.

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