Skip to content

Shadowing order - performance implications #3

Description

@x3ro

While implementing a look-up table as suggested in #2, I noticed that that the "shadowing order" is "first value for a key shadows all others". Therefore, to shadow a currently existing key inside an assoc. array, I am forced to unshift the entire array, which is much slower than just pushing a new value.

While I understand that this would be a breaking change, I suggest to change the shadowing order to "last value for a key shadows all previous", because otherwise the benefit of implementing #2 would be close to zero, given that for every unshift of the assoc. array, the lookup table would need to be completely re-calculated.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions