| ▲ | Devirtualization and Static Polymorphism(david.alvarezrosa.com) | |||||||
| 19 points by dalvrosa 3 hours ago | 4 comments | ||||||||
| ▲ | hinkley 22 minutes ago | parent | next [-] | |||||||
I wonder if I still have the link. One of the papers I had bookmarked when toying with my own language design was someone that had worked out how to make interfaces as fast or faster than vtables by using perfect hashing and using the vtable as a hash table instead of a list. You can also, when inlining a polymorphic call, put a conditional block in that bounces back to full dispatch if the call occasionally doesn’t match the common case. The problem with polymorphic inlining though is that it quickly resembles the exact sort of code we delete and replace with polymorphic dispatch: | ||||||||
| ||||||||
| ▲ | pjmlp an hour ago | parent | prev [-] | |||||||
Nice overview, it misses other kinds of dispatch though. With concepts, templates and compile time execution, there is no need for CRTP, and in addition it can cover for better error messages regarding what methods to dispatch to. | ||||||||
| ||||||||