-
Notifications
You must be signed in to change notification settings - Fork 169
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
chore(libsinsp): avoid useless allocation #2148
Conversation
Signed-off-by: Roberto Scolaro <[email protected]>
Perf diff from master - unit tests
Heap diff from master - unit tests
Heap diff from master - scap file
Benchmarks diff from master
|
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #2148 +/- ##
==========================================
- Coverage 74.69% 74.67% -0.02%
==========================================
Files 254 254
Lines 33502 33513 +11
Branches 5746 5727 -19
==========================================
+ Hits 25025 25027 +2
+ Misses 8477 8469 -8
- Partials 0 17 +17
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
Confirmed by benchmarks :) |
/milestone 0.19.0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/approve
LGTM label has been added. Git tree hash: 8b980582f5fbd3095d457c3066c8338503043b3d
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/approve
Signed-off-by: Roberto Scolaro <[email protected]>
c74d31b
to
50ffd82
Compare
@@ -358,15 +358,15 @@ TEST(async_key_value_source_test, prune_old_metadata) { | |||
ASSERT_FALSE(source.lookup(key1, response)); | |||
|
|||
// Wait long enough for the old entry to require pruning | |||
std::this_thread::sleep_for(std::chrono::milliseconds(2 * TTL_MS)); | |||
usleep(1000 * 2 * TTL_MS); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can't believe this is a sensible fix 🤣 any idea why?
Anyway, just re-triggered the CI; i will trigger it many times before proceeding.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was really out of ideas 😓 and I'm surprise as much as you. The problem should be related to the lifetime of the object and that was the only function that was related 😅
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lol
LGTM label has been added. Git tree hash: 9eed0aeb84a893aa11e528a53b1453002747c26f
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/approve
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: Andreagit97, FedeDP, therealbobo The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
What type of PR is this?
/kind cleanup
Any specific area of the project related to this PR?
/area libsinsp
Does this PR require a change in the driver versions?
What this PR does / why we need it:
Which issue(s) this PR fixes:
This avoids the allocation of a temporary object: to do that
emplace_back
needs the arguments of the constructor underlying object.Fixes #
Special notes for your reviewer:
Does this PR introduce a user-facing change?: