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

sql/rowexec: don't allocate buf per row in sketchInfo.addRow #58117

Merged

Conversation

nvanbenschoten
Copy link
Member

The intbuf array was meant to stay on the stack, but was escaping to the heap because the call through the hash function variable was opaque to escape analysis.

At the end of a 4 hour, 2.2 TB IMPORT of TPC-E, this was responsible for 76.70% of all heap allocations (by object).

Screen Shot 2020-12-20 at 9 58 04 PM

The `intbuf` array was meant to stay on the stack, but was escaping
to the heap because the call through the `hash` function variable was
opaque to escape analysis.

At the end of a 4 hour, 2.2 TB IMPORT of TPC-E, this was responsible
for **76.70%** of all heap allocations.
@cockroach-teamcity
Copy link
Member

This change is Reviewable

@RaduBerinde
Copy link
Member

Wow, nice find! LGTM! Can you backport to both 20.1 and 20.2?

@nvanbenschoten
Copy link
Member Author

Can you backport to both 20.1 and 20.2?

Sure!

bors r+

@craig craig bot merged commit e552218 into cockroachdb:master Dec 21, 2020
@craig
Copy link
Contributor

craig bot commented Dec 21, 2020

Build succeeded:

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.

3 participants