When can the C++ compiler devirtualize a call?
20 points
1 day ago
| 1 comment
| quuxplusone.github.io
| HN
lowbloodsugar
31 minutes ago
[-]
For comparison, Java will devirtualize calls if the call site typically calls only a single type. To the extent that writing a byte to a ByteBuffer, which looks like five or six virtual calls if you follow the java source code, actually ends up being a single assembly store instruction.
reply