Skip to content

Move memo dropping off to another thread #874

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

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

Veykril
Copy link
Member

@Veykril Veykril commented May 22, 2025

Design considerations to be solved:

  • How should panics be handled within drop impls, right now they are caught and discarded
  • Make the mode for dropping toggleable

Still needs a test

Copy link

netlify bot commented May 22, 2025

Deploy Preview for salsa-rs canceled.

Name Link
🔨 Latest commit 66c99be
🔍 Latest deploy log https://app.netlify.com/projects/salsa-rs/deploys/685138d1e0c1e700080fff6b

@Veykril Veykril force-pushed the veykril/push-proytsnlytqr branch 2 times, most recently from 8237471 to ce1baa4 Compare May 22, 2025 09:58
Copy link

codspeed-hq bot commented May 22, 2025

CodSpeed Performance Report

Merging #874 will degrade performances by 10.07%

Comparing Veykril:veykril/push-proytsnlytqr (66c99be) with master (87a730f)

Summary

❌ 3 regressions
✅ 9 untouched benchmarks

⚠️ Please fix the performance issues or acknowledge them on CodSpeed.

Benchmarks breakdown

Benchmark BASE HEAD Change
mutating[10] 13.6 µs 15.2 µs -10.07%
mutating[20] 13.8 µs 15.3 µs -9.76%
mutating[30] 13.9 µs 15.4 µs -9.66%

@Veykril Veykril force-pushed the veykril/push-proytsnlytqr branch from ce1baa4 to c715adb Compare May 22, 2025 10:04
@Veykril
Copy link
Member Author

Veykril commented May 22, 2025

Regressions are kind of expected given we no longer keep the boxcar allocation from before.

@Veykril Veykril force-pushed the veykril/push-proytsnlytqr branch 2 times, most recently from 7be2574 to bcca0a3 Compare May 24, 2025 07:37
false,
if tracing::enabled!(Level::DEBUG) {
Some(Box::new(|event| {
tracing::debug!("salsa_event({:?})", event)
Copy link
Contributor

Choose a reason for hiding this comment

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

Since you're touching this:

Suggested change
tracing::debug!("salsa_event({:?})", event)
tracing::debug!(?event, "salsa_event")

@@ -1,9 +1,18 @@
use std::mem;

use crossbeam_utils::sync::{Parker, Unparker};
Copy link
Contributor

Choose a reason for hiding this comment

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

might be too much of a lift, but is there any chance you can replace these with shuttle's park/unpark primitives? I assume you'll need to replicate crossbeam_utils in the sync module, unfortunately.


/// An untyped memo that can only be dropped.
#[derive(Debug)]
pub struct MemoDrop(NonNull<DummyMemo>, unsafe fn(NonNull<DummyMemo>));
Copy link
Contributor

Choose a reason for hiding this comment

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

Three things:

  1. I didn't know it was legal to write unsafe fn(NonNull<DummyMemo>). I'm guessing that if you pass it a safe closure, this will fail to compile?
  2. Can you make these named fields instead of tuple structs?
  3. I really think this should be tested with Shuttle. if you're okay with me pushing to your branch, i can do that?

@Veykril Veykril force-pushed the veykril/push-proytsnlytqr branch from 01799e6 to 66c99be Compare June 17, 2025 09:43
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.

2 participants