-
Notifications
You must be signed in to change notification settings - Fork 158
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
Replace unnecessary Arc
by Box
#635
Conversation
✅ Deploy Preview for salsa-rs canceled.
|
CodSpeed Performance ReportMerging #635 will not alter performanceComparing Summary
|
5778f5b
to
98d7005
Compare
Arc
by Box
5778f5b
to
c2da7c3
Compare
seems spurious to me as I can't reproduce it |
c2da7c3
to
754f678
Compare
I don't remember the test being spurious before... But @davidbarsky might know more |
754f678
to
1dc7ff4
Compare
Likewise, an empty `Box`ed slice does not allocate so we can remove the `lazy_static` that was needed before
1dc7ff4
to
38207e4
Compare
Uuh, I cancelled the first CI run as I pushed twice and apparently that just skips the merge queue? 🤨 |
Not the first time it seems, it even failed on master before https://github.com/salsa-rs/salsa/actions/runs/12397086201/job/34606629011 |
This was a recent development, but it seems consistently spurious on CI. I'm unable to reproduce this issue locally, however, which feels a bit concerning to me. |
I can reproduce it by making the main thread sleep for a bit after spawning the other thread it seems |
Ah, yeah, this is sufficient for me to reproduce: diff --git a/tests/parallel/parallel_map.rs b/tests/parallel/parallel_map.rs
index 80e4ebeafe..278bbfedd8 100644
--- a/tests/parallel/parallel_map.rs
+++ b/tests/parallel/parallel_map.rs
@@ -79,6 +79,7 @@
let db = db.clone();
move || a1(&db, input)
});
+ std::thread::sleep(std::time::Duration::from_millis(100));
let counts = (2..=20).collect::<Vec<u32>>(); |
Ah I can see the problem I think, by the time the signal passes we will no longer do any cancellable work in the |
QueryEdges
wereArc
ed before, but we only ever clone them for LRU evictions (and there the original one will drop right after eviction), this is a rare occurence. Additionally to save on constantly allocating an emptyArc
in the case where no deps exist, we needed alazy_static
. Instead, weBox
the slice now, dropping the need for ref-counting as well as thelazy_static
as an empty slice never allocates in aBox
.Another improvement we should make is use a
ThinBox
once that's a thing, we don't really make use of the length directly and it would shave off 4/8 bytes for Memo/QueryRevisions.