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

Reduce compile time contribution of next_key_seed and next_value_seed #436

Merged
merged 2 commits into from
Aug 6, 2024

Conversation

s-nie
Copy link
Contributor

@s-nie s-nie commented Aug 6, 2024

The next_key_seed and next_value_seed produce many LLVM IR lines, slowing down the compilation. They only need to generate a fraction of the lines as they can share most of the code.

deserialize_map and serde_userdata are also candidates for optimization, but this PR does not touch them.

Comment on lines +549 to +553
match self.next_key_deserializer() {
Ok(Some(key_de)) => seed.deserialize(key_de).map(Some),
Ok(None) => Ok(None),
Err(error) => Err(error),
}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

If you prefer I can make this more idiomatic, but in functions that get instantiated a lot, I prefer to keep it simple to keep the generated lines minimal.

@khvzak khvzak merged commit 0c08cda into mlua-rs:main Aug 6, 2024
128 checks passed
@khvzak
Copy link
Member

khvzak commented Aug 6, 2024

Thanks!

s-nie added a commit to s-nie/mlua that referenced this pull request Aug 21, 2024
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.

2 participants