-
Notifications
You must be signed in to change notification settings - Fork 293
CP-307958: small DB improvements and benchmarks #6461
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
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
No functional change Signed-off-by: Edwin Török <[email protected]>
No functional change Signed-off-by: Edwin Török <[email protected]>
Use an attribute to change the name of the fields instead of serializing with one name,
and then mapping to the other.
`ministat` confirms an improvement on `rpc_of_event`:
```
N Min Max Median Avg Stddev
x 922 440.79126 46094.975 467.83727 563.79259 1676.0843
+ 1131 51.346821 33407.866 58.715393 115.98006 1105.4178
Difference at 95.0% confidence
-447.813 +/- 120.966
-79.4286% +/- 13.1488%
(Student's t, pooled s = 1390.95)
```
Signed-off-by: Edwin Török <[email protected]>
Atomic has lower overhead, and can be used for simple situations (incrementing an integer, setting a boolean).
```
Mutex+incr (ns):
{ monotonic-clock per run = 32.272091 (confidence: 32.365531 to 32.170138);
r² = Some 0.999441 }
Atomic.incr (ns):
{ monotonic-clock per run = 2.938678 (confidence: 2.944486 to 2.933688);
r² = Some 0.999857 }
```
No functional change
Signed-off-by: Edwin Török <[email protected]>
No measurable performance change, but this makes it clearer for deadlock detection algorithms that we are waiting to acquire a lock. It'll also make it clearer for OCaml 5's thread sanitizer that values are modified with a lock held. Signed-off-by: Edwin Török <[email protected]>
No functional change Signed-off-by: Edwin Török <[email protected]>
The double ref is not needed, replace it with an Atomic.t No functional change. Signed-off-by: Edwin Török <[email protected]>
Signed-off-by: Edwin Török <[email protected]>
Contributor
|
There is a bit of weirdness again, probably with Looks good otherwise |
lindig
approved these changes
May 12, 2025
Contributor
lindig
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good. I see this mostly as a move from references to Atomic.
psafont
approved these changes
May 12, 2025
github-merge-queue bot
pushed a commit
that referenced
this pull request
May 15, 2025
…me (#6462) Builds on top of #6461 Benchmark results are on individual commits. The most significant one: `ministat` confirms a speedup: ``` Db.Pool.get_all_records : N Min Max Median Avg Stddev x 432 54115.256 493532.78 56048.42 57937.384 24117.68 + 524 22642.778 333257.36 23595.495 24679.258 15206.708 Difference at 95.0% confidence -33258.1 +/- 2513.99 -57.4036% +/- 2.90374% (Student's t, pooled s = 19737.2) >>>> Db.VM.set_NVRAM : N Min Max Median Avg Stddev x 132 36794 2355369.4 1095736.6 1107222.1 298247.5 + 168 49167.417 1485278.1 678231.31 685636.89 161480.92 Difference at 95.0% confidence -421585 +/- 52835.6 -38.0759% +/- 3.54275% (Student's t, pooled s = 231767) ```
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
We were converting events to RPC.t twice: first using the internal OCaml names, and then mapping them back to some "wire" names. This can be done a lot more simply by generating the wire names in the first place (the ppx support overriding the wire name of fields).
ministatconfirms an improvement onrpc_of_event:Atomic is also faster than an integer wrapped with a mutex:
I've added some new new benchmarks for event field conversion, atomic vs mutex and DB field writes.