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

perf(encoding): reserve memory before the row encoding. #8877

Closed
st1page opened this issue Mar 30, 2023 · 2 comments · Fixed by #8909
Closed

perf(encoding): reserve memory before the row encoding. #8877

st1page opened this issue Mar 30, 2023 · 2 comments · Fixed by #8909
Assignees
Milestone

Comments

@st1page
Copy link
Contributor

st1page commented Mar 30, 2023

after #8692 we can get the row encoding size before we really encode a row. So we can reserve the buffer before encoding.

optimizing target: Row::value_serialize https://github.com/singularity-data/risingwave/blob/main/src/common/src/row/mod.rs#L80

bench:

cd ./src/common
cargo bench --bench bench_row -- basic
@github-actions github-actions bot added this to the release-0.19 milestone Mar 30, 2023
@st1page
Copy link
Contributor Author

st1page commented Mar 30, 2023

c.c. @BugenZhao feel free to comment if you have any idea, thanks!

@fuyufjh
Copy link
Member

fuyufjh commented Mar 30, 2023

If estimate_size() is most likely to be more than the actual length, then it would be perfect, but I guess currently estimate_size() gives a average approximating size, which means, it could be more or less than the actuall length.

Please make sure to cover all data types in this micro-benchmark.

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 a pull request may close this issue.

3 participants