Skip to content

Replace ThreadId usages with ZalsaLocalid #870

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 1 commit into
base: master
Choose a base branch
from

Conversation

MichaReiser
Copy link
Contributor

Experiment if this helps with performance. I may also need this to enforce a strict ordering between different threads that all run the same fixpoint iteration (ThreadId::as_u64 is nightly)

Copy link

netlify bot commented May 20, 2025

Deploy Preview for salsa-rs canceled.

Name Link
🔨 Latest commit f8d35db
🔍 Latest deploy log https://app.netlify.com/projects/salsa-rs/deploys/682c7b7d338a3d00096025b2

Copy link

codspeed-hq bot commented May 20, 2025

CodSpeed Performance Report

Merging #870 will not alter performance

Comparing MichaReiser:zalsa-local-id (f8d35db) with master (4818b15)

Summary

✅ 12 untouched benchmarks

Copy link
Member

@Veykril Veykril left a comment

Choose a reason for hiding this comment

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

Sounds reasonable, given we can't share ZalsaLocal's across threads (due to it being !Sync)


#[derive(Debug, Default)]
pub(super) struct DependencyGraph {
/// A `(K -> V)` pair in this map indicates that the runtime
/// `K` is blocked on some query executing in the runtime `V`.
/// This encodes a graph that must be acyclic (or else deadlock
/// will result).
edges: FxHashMap<ThreadId, edge::Edge>,
edges: FxHashMap<ZalsaLocalId, edge::Edge>,

/// Encodes the `ThreadId` that are blocked waiting for the result
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
/// Encodes the `ThreadId` that are blocked waiting for the result
/// Encodes the `ZalsaLocalId` that are blocked waiting for the result

@MichaReiser
Copy link
Contributor Author

Another alternative here would be to store the ThreadId on ZalsaLocal to avoid the need to query it over and over again (which clones an Arc)

@Veykril
Copy link
Member

Veykril commented May 22, 2025

Another alternative here would be to store the ThreadId on ZalsaLocal to avoid the need to query it over and over again (which clones an Arc)

Then we would need to make ZalsaLocal !Send which does not sound feasible

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