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

Use a shared_mutex for read Dictionary operations #9657

Merged
merged 1 commit into from
Feb 10, 2023

Conversation

Al2Klimov
Copy link
Member

This allows multiple parallel read operations resulting in a overall speedup on systems with many cores.

#9627

real user sys
23m41,989s 1056m24,028s 207m46,986s
24m10,306s 1084m32,750s 199m45,335s
24m58,666s 1152m39,816s 168m35,401s
25m16,643s 1156m18,189s 201m20,795s
23m5,677s 1044m19,698s 186m54,275s
24m26,794s 1112m13,336s 184m30,857s
23m5,215s 1049m22,950s 186m35,814s
23m30,688s 1061m56,622s 184m29,615s
23m37,115s 1073m8,501s 185m36,210s
22m32,282s 1037m58,185s 166m31,956s

#9627 + this PR

real user sys
21m0,810s 1116m15,330s 3m52,515s
21m32,898s 1150m21,358s 4m11,779s
20m59,009s 1115m39,142s 3m54,868s
21m53,785s 1171m41,773s 3m58,269s
21m18,770s 1128m18,154s 4m1,864s
21m3,465s 1124m55,727s 4m5,976s
21m48,964s 1165m7,774s 4m3,180s
20m10,108s 1077m6,399s 4m9,552s
20m56,285s 1118m42,794s 3m56,123s
20m18,122s 1084m51,305s 4m1,666s

@Al2Klimov Al2Klimov added the core/quality Improve code, libraries, algorithms, inline docs label Feb 8, 2023
@Al2Klimov Al2Klimov added this to the 2.14.0 milestone Feb 8, 2023
@cla-bot cla-bot bot added the cla/signed label Feb 8, 2023
@icinga-probot icinga-probot bot added the area/configuration DSL, parser, compiler, error handling label Feb 8, 2023
Copy link
Contributor

@julianbrost julianbrost left a comment

Choose a reason for hiding this comment

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

Surprising impact on performance, I wouldn't have expected so much contention on dicts. But from the change in system CPU time, this looks quite similar to the corresponding change in namespaces.

lib/base/dictionary.cpp Outdated Show resolved Hide resolved
@Al2Klimov
Copy link
Member Author

Apply rules eat vars. Vars are dicts.

This allows multiple parallel read operations resulting
in a overall speedup on systems with many cores.
@julianbrost
Copy link
Contributor

Yes, I just expected less contention as these variables are per object, but apparently there is quite some of it.

@julianbrost julianbrost merged commit 0dd35bb into master Feb 10, 2023
@icinga-probot icinga-probot bot deleted the shared_mutex-Dictionary branch February 10, 2023 14:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/configuration DSL, parser, compiler, error handling cla/signed core/quality Improve code, libraries, algorithms, inline docs
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants