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

shell: Speedup row printing #150

Merged
merged 1 commit into from
Jul 20, 2021

Conversation

MathieuBordere
Copy link
Contributor

@MathieuBordere MathieuBordere commented Jul 20, 2021

Looks like the converting the row to a string takes a large amount of time, these changes amount to approx. a 4x speed increase when performing select * from kine LIMIT 10000; on a large kine database. Expect the speedup to be similar for other use cases.

Signed-off-by: Mathieu Borderé mathieu.bordere@canonical.com

Copy link
Member

@tomponline tomponline left a comment

Choose a reason for hiding this comment

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

Out of interest, did you also try using StringBuilder, which would avoid the intermediate slice?

https://www.calhoun.io/concatenating-and-building-strings-in-go/

@MathieuBordere
Copy link
Contributor Author

Out of interest, did you also try using StringBuilder, which would avoid the intermediate slice?

https://www.calhoun.io/concatenating-and-building-strings-in-go/

No, will give it a spin, thanks

Signed-off-by: Mathieu Borderé <mathieu.bordere@canonical.com>
@MathieuBordere
Copy link
Contributor Author

MathieuBordere commented Jul 20, 2021

Out of interest, did you also try using StringBuilder, which would avoid the intermediate slice?

https://www.calhoun.io/concatenating-and-building-strings-in-go/

Cool, turns out using strings.Builders amounts to another 30x speedup on top of the 4x, so 120x in total :-) Thanks!

@tomponline
Copy link
Member

Out of interest, did you also try using StringBuilder, which would avoid the intermediate slice?
https://www.calhoun.io/concatenating-and-building-strings-in-go/

Thanks, turns out using strings.Builders amounts to another 30x speedup on top of the 4x :-)

Awesome! :)

@tomponline
Copy link
Member

@MathieuBordere does test coverage check failure block merges in this project?

@MathieuBordere
Copy link
Contributor Author

@MathieuBordere does test coverage check failure block merges in this project?

It doesn't, no.

@tomponline tomponline merged commit 986847e into canonical:master Jul 20, 2021
@MathieuBordere MathieuBordere deleted the speedup-select-results branch December 9, 2022 10:29
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

2 participants