Discussion:
[Freecol-developers] internal getters vs performance
Enrico Weigelt, metux IT consult
2016-12-08 16:50:41 UTC
Permalink
Hi folks,

we've got a lot of trivila getters that are heavily used within
their classes. As they're public and not final, the compiler can't
inline them (it must assume that they might be overwritten by derived
classes), which of course introduces a performance penalty.

Should we instead make them final or use the underlying fields
directly ?

--mtx
Michael T. Pope
2016-12-08 21:02:44 UTC
Permalink
On Thu, 8 Dec 2016 17:50:41 +0100
Post by Enrico Weigelt, metux IT consult
we've got a lot of trivila getters that are heavily used within
their classes. As they're public and not final, the compiler can't
inline them (it must assume that they might be overwritten by derived
classes), which of course introduces a performance penalty.
Should we instead make them final or use the underlying fields
directly ?
We could. Patches welcome. This is low priority stuff though.

Cheers,
Mike Pope
Enrico Weigelt, metux IT consult
2016-12-08 22:47:08 UTC
Permalink
Post by Michael T. Pope
Post by Enrico Weigelt, metux IT consult
Should we instead make them final or use the underlying fields
directly ?
We could. Patches welcome. This is low priority stuff though.
Okay, I'll do that when touching these places for other reasons.

--mtx

Loading...