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.
Problem
Functions in the library like
useHookState(and as a result, all hooks, andqueryChanged) andsystemNameare slow. They usedebug.infoand each call todebug.infotakes 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,queryChangedand 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.