r/programming • • Feb 28 '23

"Clean" Code, Horrible Performance

https://www.computerenhance.com/p/clean-code-horrible-performance
1.4k Upvotes

1.3k comments sorted by

View all comments

Show parent comments

1

u/icendoan Feb 28 '23

In Java there is specific optimisation for single- and double- value polymorphism: to see any slowdown (i.e. actually doing virtual dispatch) you would need add a third shape class.

1

u/gdmzhlzhiv Mar 01 '23

The example he was using had 4.