Skip to content
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

Store SpanIds as integers #10512

Merged
merged 2 commits into from Jul 30, 2020
Merged

Conversation

stuhood
Copy link
Sponsor Member

@stuhood stuhood commented Jul 30, 2020

Problem

We currently store SpanIds as hex strings (meaning that we have to allocate), but they are always 64 bit random values.

Solution

Switch the internal representation of a SpanId to a newtype wrapping u64.

Result

Less memory usage and allocation.

[ci skip-build-wheels]

@stuhood
Copy link
Sponsor Member Author

stuhood commented Jul 30, 2020

The commits are useful to review independently: the second commit just removes clone() calls that are no longer necessary because SpanId is Copyable.

Copy link
Contributor

@tdyas tdyas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

Copy link
Contributor

@Eric-Arellano Eric-Arellano left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@coveralls
Copy link

coveralls commented Jul 30, 2020

Coverage Status

Coverage remained the same at 0.0% when pulling 104d654 on stuhood:stuhood/spanids-as-ints into 8175171 on pantsbuild:master.

@stuhood stuhood merged commit 5137050 into pantsbuild:master Jul 30, 2020
@stuhood stuhood deleted the stuhood/spanids-as-ints branch July 30, 2020 20:28
@gshuflin
Copy link
Contributor

Great change!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants