Update value bench and unbox variants based on the result#946
Open
Huliiiiii wants to merge 9 commits intoSeaQL:masterfrom
Open
Update value bench and unbox variants based on the result#946Huliiiiii wants to merge 9 commits intoSeaQL:masterfrom
Huliiiiii wants to merge 9 commits intoSeaQL:masterfrom
Conversation
Member
Author
Member
Author
|
Well, BurntSushi/jiff#400 explains why I didn’t see any performance impact — in release mode, it’s effectively a comparison between 32 and 40. |
tyt2y3
reviewed
Aug 15, 2025
| const fn check_value_size() -> usize { | ||
| if std::mem::size_of::<Value>() > 32 { | ||
| panic!("the size of Value shouldn't be greater than 32 bytes") | ||
| if std::mem::size_of::<Value>() > 104 { |
Member
There was a problem hiding this comment.
sad, this basically makes this check useless, unless we relax it in debug mode and stricten it in release mode.
but our CI don't run release mode, so there is no checks anyway.
given that sqlx-binder is still WIP, I wouldn't act on this until there is full sqlx support and #943 is merged.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PR Info
Update benchmarks and unbox Value based on the results.
Benchmarks show that in typical cases, making
Valuesmaller does not improve performance. On the contrary, and each heap-allocated value will cause a 1-1.5% performance loss.This makes sense, since
Valueis usually stored inside a Vec or a Box, such as inExpr::Binary.