-
Notifications
You must be signed in to change notification settings - Fork 6.1k
expression: reserve exact space for UUIDs #65365
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
Conversation
|
Skipping CI for Draft Pull Request. |
|
Hi @dveeden. Thanks for your PR. PRs from untrusted users cannot be marked as trusted with I understand the commands that are listed here. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
|
/ok-to-test |
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## master #65365 +/- ##
================================================
- Coverage 78.3390% 76.5455% -1.7936%
================================================
Files 1940 1953 +13
Lines 535314 539223 +3909
================================================
- Hits 419360 412751 -6609
- Misses 114433 125663 +11230
+ Partials 1521 809 -712
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
windtalker
left a comment
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.
lgtm
zanmato1984
left a comment
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.
LGTM
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: windtalker, zanmato1984 The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
[LGTM Timeline notifier]Timeline:
|
|
/retest |
|
/retest |
1 similar comment
|
/retest |
What problem does this PR solve?
Issue Number: close #65364
Problem Summary:
result.ReserveString(n)reserves space for a string, but doesn't take into account thatUUID(),UUID_V4()andUUID_V7()all create 36-byte text format UUIDs.What changed and how does it work?
With a
t1table with 36 rows:So we have
n=36for 36 rows. Anddatahas a capacity of 256 before callingresult.ReserveStringWithSizeHint(n, UUID_STR_LEN)So after the call to
ReserveStringWithSizeHint()(with (36, 36) as arguments for 36 rows of 36 bytes/chars) we have adatawith a capacity of 1296 (= 36*36).Now let's set a breakpoint at the line where we return form this function.
So after getting 36 UUID's we do see a
datawith a capacity of 1296 and a length of 1296.Check List
Tests
Side effects
Documentation
Release note
Please refer to Release Notes Language Style Guide to write a quality release note.