-
Notifications
You must be signed in to change notification settings - Fork 23
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
Optionally use perfect hashing for field path matching in derive macro apply
#7
Comments
@kabergstrom What about using field indices instead of field names, like with tuples? |
I implemented that here: 5afe403 |
Ah, nice! And how to enable that for a struct? |
Use |
Above comment has become: let diff = Config::new()
.with_field_path_mode(FieldPathMode::Index)
.serializable_diff(&old, &new); |
Field paths are serialized as strings, and applying a diff to a large struct can be costly due to excessive string matching. It should be possible to leverage one of the crates in the ecosystem for perfect hashing when generating code for
apply
in the derive macro.The text was updated successfully, but these errors were encountered: