-
Notifications
You must be signed in to change notification settings - Fork 37
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
Dynamic dispatch for storage? #109
Comments
@yoshuawuyts do you have an opinion on this? |
We could even have a |
@Frando big fan of erasing types in cases like these. Think this is a reasonable direction to explore. |
Great!
@Frando if you haven't already started, I could take a look. I am planning
to do some love coding this Sunday and I could box the types
Em qua, 13 de mai de 2020 08:23, Yoshua Wuyts <[email protected]>
escreveu:
… @Frando <https://github.com/Frando> big fan of erasing types in cases
like these. Think this is a reasonable direction to explore.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#109 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAA2XIVHM5BZC5FDQRPB4ZDRRJ7JTANCNFSM4MD3MMFA>
.
|
@bltavares very cool. I did start a bit on this some time but didn't publish yet. I opened #113 with what I have. It's unfinished. Please feel very free to continue there and just push to the branch dircectly, and/or do a new clean start. I ran into an issue wrt to boxing the individual RandomAccess instances, it's explained in a comment on #113. If you have an idea on how to solve that that would be amazing. Otherwise I think we can also continue with the approach in #113. |
Hi,
I've been thinking about whether it would make sense to remove the generic
Storage<T>
field on theFeed
struct and instead have aBox<dyn DynStorage>
object on the Feed.DynStorage
would be a trait with all public methods ofStorage<T>
. Thus,Feed<T>
would just beFeed
.Benefits:
Feed
.Drawbacks:
I would guess that compiler optimizations might oftenly reduce the cost of dynamic dispatch if you'd only use one implementation in your code paths, but I'm not sure about it.
Opinions?
The text was updated successfully, but these errors were encountered: