Closed kinyoklion closed 3 months ago
I am going to make a couple changes.
ldvalue.CopyArbitraryValue(defaultValue)
is allocating. If I run the benchmark with that line I get 1 alloc per op. If I remove it I get 0. So I need to look at that.I am going to make a couple changes.
- Skip execution when no hooks registered.
- ~
ldvalue.CopyArbitraryValue(defaultValue)
is allocating. If I run the benchmark with that line I get 1 alloc per op. If I remove it I get 0. So I need to look at that.~ Removed the need for this.
I am not sure there would actually be any tangible benefit to 1, at least with the ability to dynamically register hooks.
In node I was able to avoid the micro-task queue, but in Go I would incur the lock to check regardless and that would be the most expensive part.
This PR should be reviewed before other hooks PRs.
This PR adds supporting types for hooks, but does not use them from the client.