-
Notifications
You must be signed in to change notification settings - Fork 164
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
Have salsa not depend on salsa-macros #750
base: master
Are you sure you want to change the base?
Conversation
✅ Deploy Preview for salsa-rs canceled.
|
|
||
#[doc(hidden)] | ||
fn zalsa_register_downcaster(&self) { | ||
// The no-op downcaster is special cased in view caster construction. | ||
} | ||
|
||
#[doc(hidden)] | ||
#[inline(always)] | ||
unsafe fn downcast(db: &dyn Database) -> &dyn Database | ||
where | ||
Self: Sized, | ||
{ | ||
// No-op | ||
db | ||
} |
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.
Interestingly enough, this change also means that one does not actually need to use #[salsa::db]
on trait impls for the baseline Database
CodSpeed Performance ReportMerging #750 will improve performances by 8.52%Comparing Summary
Benchmarks breakdown
|
That way salsa can build without having to build the proc-macro ecosystem, improving build times for dependants of salsa
e13f1d3
to
fa8c391
Compare
#[doc(hidden)] | ||
fn zalsa_register_downcaster(&self) { | ||
// The no-op downcaster is special cased in view caster construction. | ||
} |
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.
The perf changes come from this being a no-op now, so they are kind of fake as you only get that benefit if you don't use a custom database trait, and more importantly, you only really hit this when the ingredient cache fails which in a usual setup with a single database is no the case (our benches create a bunch of databases making the ingredient cache useless for them)
That way salsa can build without having to build the proc-macro ecosystem, improving build times for dependants of salsa