Should I declare getters and setters __forceinline ?

Closed due to the fact that it is necessary to reformulate the question so that it was possible to give an objectively correct answer to the participants of VenZell , zRrr , aleksandr barakin , user194374, Dmitriy Simushev Mar 27 '16 at 18:06 .

The question gives rise to endless debates and discussions based not on knowledge, but on opinions. To get an answer, rephrase your question so that it can be given an unambiguously correct answer, or delete the question altogether. If the question can be reformulated according to the rules set out in the certificate , edit it .

  • what's the point? performance? - KoVadim
  • four
    and already profiled? learned that this is a bottleneck? - KoVadim
  • A similar question - Stackoverflow.com/q/480846/177684 - Abyx
  • What do they look like? - Qwertiy
  • If you are given an exhaustive answer, mark it as correct (a daw opposite the selected answer). - Nicolas Chabanovsky

1 answer 1

Not.

__forceinline can be used only if the profiling and analysis of the generated code has shown that it can significantly improve performance in each case.

  • And what, the compiler forbids it to use, if not to make profiling? :) - KoVadim
  • 3
    @KoVadim, it would not be bad if the compiler forbade something to be done until profiling is done :-D - Grundy
  • @KoVadim prohibits common sense. - Abyx
  • @Abyx, and perhaps embedding does not always improve performance, by removing the function call? - Grundy
  • 3
    @Grundy from embedding increases the amount of code, it can reduce performance (the predictor is more difficult to work, the code can not get into the cache). - Abyx