-
Notifications
You must be signed in to change notification settings - Fork 183
Do manual trait casting #922
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
base: master
Are you sure you want to change the base?
Conversation
✅ Deploy Preview for salsa-rs canceled.
|
CodSpeed Performance ReportMerging #922 will improve performances by 4.2%Comparing Summary
Benchmarks breakdown
|
2073e08
to
28acf8c
Compare
Benchmarks look fairly noisy again to me |
Not sure, 5% is a bit more than usual. |
Well the increase seems to stem from ingredient fetching which means its likely the |
0b13ad9
to
e50ed3a
Compare
Okay the regression came from a dumb mistake |
e50ed3a
to
523d4c8
Compare
Some context for reviewing aid, there are couple of noisy changes (that I could've split out into separate commits, sorry):
|
} | ||
} | ||
|
||
/// Upcast to a `dyn Database`. | ||
/// | ||
/// Only required because upcasts not yet stabilized (*grr*). | ||
/// Only required because upcasting does not work for unsized generic parameters. |
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 am quite annoyed by this but that's a limitation of Rust, a &T
of T: ?Sized + SomeTrait
cannot be coerced to a &dyn SomeTrait
(or a supertrait) due to T
possibly being an unrelated unsized type like str
f553491
to
70bdaef
Compare
This removes occurences of
dyn Database
internally where only the zalsas are needed for (hopefully) a perf increase.Lastly it renames downcasting to upcasting, because thats what we are doing,
dyn Database
--downcast->Concrete
--upcast-->dyn CustomDatabaseTrait