On Friday, 14 July 2017 at 22:45:44 UTC, H. S. Teoh wrote:
Result: 8MB executable size (!).

Of course, this comes at a runtime cost of an added level of indirection (now you have to call a virtual function through the interface to integrate with earlier components in the pipeline). But at a 60% reduction in executable size, I think it's a worthwhile tradeoff. :-)

That's a very interesting idea!
However, I wouldn't want to insert this into code manually, maybe a simple flag-opt-in support in DMD that detects UFCS pipes with X components and then inserts the type erasure hack could solve most problems for the time being? That way it wouldn't create a WTF moment when explaining D code and when Stefan or someone else manages to implement something more sophisticated, no code would need an update.


Reply via email to