Refactored service binding#66
Open
spoenemann wants to merge 6 commits intomainfrom
Open
Conversation
msujew
reviewed
Apr 30, 2026
Member
msujew
left a comment
There was a problem hiding this comment.
Thanks, makes this a lot easier to understand.
Member
Author
|
With the service caching, we're even 0.3% faster than on main: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I feel the service container approach introduced in #6 is too complicated. I propose to simplify it as done in this PR.
We define a
service.Containerutility where you can register (MustPutorMustOverride) and retrieve (GetorMustGet) service instances. There's no "injection" – every service simply keeps a pointer to the service container and retrieves things when they're needed.Performance Impact
I added a helper program to run a standardized benchmark:
On main:
On this PR:
This is 0.25% slower than before, probably due to the hash map lookups.