-
Notifications
You must be signed in to change notification settings - Fork 5.9k
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
errctx, types, sessionctx: avoid memory allocation in HandleError
and reduce allocation in creation of statement context
#49280
Conversation
da74a72
to
728130f
Compare
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## master #49280 +/- ##
================================================
+ Coverage 71.0490% 71.9498% +0.9008%
================================================
Files 1368 1409 +41
Lines 402149 416358 +14209
================================================
+ Hits 285723 299569 +13846
- Misses 96553 97939 +1386
+ Partials 19873 18850 -1023
Flags with carried forward coverage won't be shown. Click here to find out more.
|
Signed-off-by: Yang Keao <[email protected]>
/retest |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: lcwangchao, tangenta 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 |
[LGTM Timeline notifier]Timeline:
|
What problem does this PR solve?
Issue Number: close #49277
Problem Summary:
We use a function closure to represent the function used to append warning, which actually creates a struct on heap to store the closure. A smaller example can be found in #49277 . Here I try to use an interface to remove this memory allocation.
What changed and how does it work?
Use an interface rather than the closure to reduce the memory allocation.
Before:
After:
It doesn't allocate heap memory anymore, which will be even more helpful when the GC pressure is heavy.
Check List
Tests
Release note