You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The PR you linked introduces a heuristic, i.e. it sums the sizes of Rust representations of all the columns in tuples/Vec/slice using std::mem::size_of_val. The std::mem::size_of_val function will sometimes correspond to the serialized CQL size of a value, but not always - for example, if you have a Veccolumn type it will always be counted as 3 * size_of_val::<usize>(), regardless from the number of its elements.
Calculating the exact serialized size up front sometimes requires more complicated calculations, so it would require extending the ValueList/Value trait. We'd rather add this functionality to the new traits instead of investing more time in the old ones.
To sum up - this is a heuristic which should reduce the current number of reallocations; it's possible to do better, but it requires more changes.
I upgraded Catalytic to the latest version of this driver (0.10) because I saw there where performance improvements by using size_for_val here: #809. Catalytic now also uses them, e.g.: https://github.com/Jasperav/Catalytic/blob/4f9babb197c865819ef5f7537685873f97ac8037/catalytic_table_to_struct/example/src/generated/child.rs#L174
Is this the best way now or am I missing something? I see that there are now new traits coming but that can take awhile: #463
The text was updated successfully, but these errors were encountered: