-
Notifications
You must be signed in to change notification settings - Fork 202
internal: switch to boxcar from append-only-vec
#688
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
internal: switch to boxcar from append-only-vec
#688
Conversation
✅ Deploy Preview for salsa-rs canceled.
|
CodSpeed Performance ReportMerging #688 will not alter performanceComparing Summary
|
5091f03 to
5dc7d27
Compare
|
The perf difference is interesting |
|
I don't see any relevant changes in the CodSpeed diffs, but I assume the difference is because of #555 (comment). If all write paths for the ingredients vector go through a lock, I can add a |
5dc7d27 to
d5197c7
Compare
Veykril
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.
Can we use the type in a qualified manner, that is as boxcar::Vec instead of importing it? Or give the import an alias? I find it confusing to overwrite a prelude type like this
Ibraheem is far more of an expert on this than I am, but I'm guessing that that the benchmark benefits substantially from a spinlock, but those benefits evaporate under real, day-to-day conditions. At the very least, I'm extremely skeptical of spinlocks outside a few, very narrow circumstances.
Yeah, I'll refactor usages to be fully-qualified. |
e6cd4c2 to
915b079
Compare
|
Updated as per review. I'm inclined to merge this given that most of the regressions could be explained away by "spinlocks look good in benchmarks". |
|
We see a similar 4% regression on red-knot incremental performance with this change. That said, I am also inclined to merge because I think it's likely that we can avoid holding the lock during writes to boxcar (I have an idea to make this possible), which would mean we aren't single-writer anymore and the spinlocks could start to matter. I am also fine to hold off until that change happens and we have measurable results, but boxcar's implementation is more robust for future changes, and if the Loom support is important we could go either way. |
|
I think Loom support/tests are sufficiently important from a correctness perspective that I’d prefer a Loom-tested library over a non-Loom tested library. I’m also extremely interested in seeing your locking changes: I imagine it’d be useful regardless of whether I land this PR or not. |
Veykril
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.
I'm also in favor of this change despite the small regression
915b079 to
63441f0
Compare
|
Alright, I've rebased and I'll land this change. |
Boxcar now uses Loom, and I personally trust Loom/Shuttle-tested libraries more than those that aren't despite their apparent simplicity.
(cc: @ibraheemdev)