On Wednesday, 8 March 2023 at 12:46:53 UTC, Hipreme wrote:
On Wednesday, 8 March 2023 at 10:49:32 UTC, Markus wrote:
Hi, sorry for the broad and vague question. I have read in some reddit post about benchmarks, that some code didn't use the final keyword on methods in a sense that final would make it faster, I believe.

[...]

Don't bother with it. This kind of optimization is done when compiling with -O,

No they are not, simple example : https://godbolt.org/z/xfPqnWrrv
Obviously in a library `test` might be called with a derived so `v1()` target address must be read in the vtbl of the argument.

and I really doubt about your bottleneck being that you're calling a virtual call.

That is more true. vcalls dont add complexity.

Wait when you actually need to optimize before making your code ugly.


Reply via email to