On 11/13/13 12:18 PM, Kevin Ballard wrote:
The only penalty this approach has (that comes to mind) over the
single-inheritance model is that, because of the loss of the prefix
property, any field access on the trait object itself will require
looking up the field offset in the virtual table. But trait objects
already use the virtual table for everything else, and the actual trait
implementations don’t require this, so I don’t think it’s problematic to
require a virtual table lookup on trait object field access.

I think it is. This is a performance cost over C++ that is just too risky. Note that browser reflow is very much gated on the ability to load and store fields from a constant offset. I think we stand a good chance of losing to the competition if we do this.

Patrick

_______________________________________________
Rust-dev mailing list
[email protected]
https://mail.mozilla.org/listinfo/rust-dev

Reply via email to