Skip to content

assert.same has poor performance and only compares depth of back references #182

Open
@appgurueu

Description

More performant implementation that checks whether a reference mapping exists: https://github.com/minetest/minetest/blob/36c8e5a7f18d7254d9f8991cbc8cd5dd36c5f577/builtin/common/tests/serialize_spec.lua#L9-L37

Perhaps this should be added as a new assertion in order to not break backwards compat; either way my fuzzing seems to reveal that for complex circular structures assert.same has very poor (presumably exponentially poor) performance.

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