Skip to content

Conversation

jimidle
Copy link
Collaborator

@jimidle jimidle commented Mar 20, 2023

The PredictionContext in Go was an interface prior to this change. However, there was no need for an interface as the differences in the types were minor and can be catered for much faster with a simple struct and a few case statements. Interfaces are also not ideal for Generics. We can end up needing 3 pointer dereferences just to look at an int.

This PR also changes Intervals to stop using pointers. They are two simple to need that.

jimidle added 5 commits March 19, 2023 16:23
Signed-off-by: Jim.Idle <jimi@idle.ws>
Interfaces require two pointer lookups for functions and when used as
Generic, they require three. This change therefore yields a small
performance upgrade.

This change also corrects one or two copmarisons that were using pointer
comparison instead of Equals() and were bugs in the code I inherited.

Signed-off-by: Jim.Idle <jimi@idle.ws>
Signed-off-by: Jim.Idle <jimi@idle.ws>
Signed-off-by: Jim.Idle <jimi@idle.ws>
@jimidle
Copy link
Collaborator Author

jimidle commented Mar 28, 2023

@parrt - I would appreciate it if you could merge this - I am now waiting for it to complete a big bug fix for config caching. Cheers.

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

Successfully merging this pull request may close these issues.

2 participants