Skip to content

Ditch debug.info in the core library, it's slow #133

Description

@jackTabsCode

Problem

Functions in the library like useHookState (and as a result, all hooks, and queryChanged) and systemName are slow. They use debug.info and each call to debug.info takes between 5-20us depending.

Hooks are highly convenient and very useful, but these performance drawback is rather unfortunate and I think the negatives outweigh the positives, so...

Proposed solution

Ditch debug.info and require users specify a key in useHookState, queryChanged and all hooks.

Discriminators in hooks should still remain optional, as they're often used to differentiate between entities but may not always be necessary.

This is a major breaking change and will require documentation, because using the same key twice in a system will result in unexpected behavior.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    breakingIntroduces a breaking changeimprovementAn imperfection we can make better

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions