Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I guess I’m confused why an actual add instruction is emitted rather than whatever overloaded operation takes place when the + symbol (or overloaded add vtable entry) is called (like it would in other OOP languages).




If all you're doing is summing small integers---frequently the case---it's much preferable to optimize that to be fast and then skip the very dynamic method lookup (the slower, less common case)

Presumably other languages with JIT do exactly the same thing?



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: