Skip to content

Conversation

@juharris
Copy link
Owner

@juharris juharris commented Nov 28, 2025

Implement custom configuration merging to avoid big copies instead of using the config library.

From before some changes, so it should be even slightly better now:

Scenario	Config Crate	Custom Merge	Speedup
Single feature (get_options)	254 µs	30 µs	8.5x
Single feature (get_all)	284 µs	26 µs	10.9x
Multiple features (get_options)	680 µs	87 µs	7.8x
Multiple features (get_all)	761 µs	78 µs	9.8x
Cache hit	-	3.3 µs	Same

Config crate: ~254 µs for single feature, ~680 µs for multiple features
Custom merge: ~26-30 µs for single feature, ~54 µs for multiple features

@juharris juharris marked this pull request as ready for review November 29, 2025 00:38
@juharris juharris changed the title [Rust] Use custom merge for 8-10X perf improvement [Rust][get_options] Use custom merge for 8-10X perf improvement Nov 29, 2025
@juharris juharris merged commit d4e5bee into main Nov 29, 2025
46 of 47 checks passed
@juharris juharris deleted the rust-custom-merge branch November 29, 2025 01:19
Err(e) => Err(format!(
"Error combining features to build the configuration: {e}"
)),
if let Some(_cache_options) = cache_options {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
if let Some(_cache_options) = cache_options {
if cache_options.is_some() {

Copy link
Owner Author

Choose a reason for hiding this comment

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

Thanks. Done in #161

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.

3 participants