-
Notifications
You must be signed in to change notification settings - Fork 50
Metabase polish (4000 grit) #3770
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Conversation
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
Signed-off-by: Roman Khimov <[email protected]>
Signed-off-by: Roman Khimov <[email protected]>
Signed-off-by: Roman Khimov <[email protected]>
Same thing. Signed-off-by: Roman Khimov <[email protected]>
It can't be nil here. Signed-off-by: Roman Khimov <[email protected]>
…ject() Usually we don't have many associated objects of the same type, but outer cycle should still work correctly in all cases. Absent this fix we can have a broken metaCursor that will certainly not find another associated object. Signed-off-by: Roman Khimov <[email protected]>
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## master #3770 +/- ##
==========================================
- Coverage 25.74% 25.60% -0.14%
==========================================
Files 657 657
Lines 42223 42102 -121
==========================================
- Hits 10870 10781 -89
+ Misses 30366 30343 -23
+ Partials 987 978 -9 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
carpawell
approved these changes
Jan 12, 2026
End-rey
approved these changes
Jan 12, 2026
And use it where appropirate. The iterator itself is not exactly trivial, but it simplifes code using values from it, in some cases allowing to avoid additional allocations. Signed-off-by: Roman Khimov <[email protected]>
Check association first, make switch be a proper switch. Minus two tabs for the most part of the function. Signed-off-by: Roman Khimov <[email protected]>
All of users have it anyway except for Get() which is rarely called and can handle it internally. Signed-off-by: Roman Khimov <[email protected]>
Signed-off-by: Roman Khimov <[email protected]>
This allows to remove one intermediary tx function, otherwise it's all the same. Signed-off-by: Roman Khimov <[email protected]>
Drop some duplication and simplify flow. Caveat: this (inevitably) makes a bit different choice wrt invalid key handling, but this was inconsistent among users and returning an error is not very helpful in most cases. Signed-off-by: Roman Khimov <[email protected]>
Simpler and allows to allocated a bit less in some cases.
goos: linux
goarch: amd64
pkg: github.com/nspcc-dev/neofs-node/pkg/local_object_storage/metabase
cpu: AMD Ryzen 7 PRO 7840U w/ Radeon 780M Graphics
│ expired.old │ expired.new │
│ sec/op │ sec/op vs base │
Exists/existing-16 2.647µ ± 1% 2.559µ ± 0% -3.33% (p=0.001 n=10)
Exists/inexisting-16 548.1n ± 1% 539.0n ± 1% -1.66% (p=0.002 n=10)
geomean 1.204µ 1.174µ -2.50%
│ expired.old │ expired.new │
│ B/op │ B/op vs base │
Exists/existing-16 1.561Ki ± 0% 1.467Ki ± 0% -6.01% (p=0.000 n=10)
Exists/inexisting-16 376.0 ± 0% 376.0 ± 0% ~ (p=1.000 n=10) ¹
geomean 775.1 751.5 -3.05%
¹ all samples are equal
│ expired.old │ expired.new │
│ allocs/op │ allocs/op vs base │
Exists/existing-16 30.00 ± 0% 29.00 ± 0% -3.33% (p=0.000 n=10)
Exists/inexisting-16 5.000 ± 0% 5.000 ± 0% ~ (p=1.000 n=10) ¹
geomean 12.25 12.04 -1.68%
¹ all samples are equal
Signed-off-by: Roman Khimov <[email protected]>
Less code, less allocations.
goos: linux
goarch: amd64
pkg: github.com/nspcc-dev/neofs-node/pkg/local_object_storage/metabase
cpu: AMD Ryzen 7 PRO 7840U w/ Radeon 780M Graphics
│ expired.old │ expired.new │
│ sec/op │ sec/op vs base │
Exists/existing-16 2.559µ ± 0% 2.518µ ± 1% -1.60% (p=0.001 n=10)
Exists/inexisting-16 539.0n ± 1% 541.8n ± 2% ~ (p=0.089 n=10)
geomean 1.174µ 1.168µ -0.55%
│ expired.old │ expired.new │
│ B/op │ B/op vs base │
Exists/existing-16 1.467Ki ± 0% 1.389Ki ± 0% -5.33% (p=0.000 n=10)
Exists/inexisting-16 376.0 ± 0% 376.0 ± 0% ~ (p=1.000 n=10) ¹
geomean 751.5 731.2 -2.70%
¹ all samples are equal
│ expired.old │ expired.new │
│ allocs/op │ allocs/op vs base │
Exists/existing-16 29.00 ± 0% 28.00 ± 0% -3.45% (p=0.000 n=10)
Exists/inexisting-16 5.000 ± 0% 5.000 ± 0% ~ (p=1.000 n=10) ¹
geomean 12.04 11.83 -1.74%
¹ all samples are equal
Signed-off-by: Roman Khimov <[email protected]>
A bit more common pattern. Signed-off-by: Roman Khimov <[email protected]>
Signed-off-by: Roman Khimov <[email protected]>
1bc53ea to
0e9d8cb
Compare
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.
No functional changes.