Marcus LaGrone
Member
I have a very math intensive bit of code running a giant pile of things that also include a bunch of LUTs. So I sat down to see which of the various optimizations gave me the fastest code.
Space? who cares! I want speed!
So, at the start of the code I throw a pin high and at the end, throw it low and measured it on the o-scope.
going from Fast to Fastest with LTO on every other one I got:
15.56 us
16.36 us
14.44 us
14.28 us
14.52 us
14.12 us
with the last being "Fastest with LTO"
It was funny that "faster" was faster than "fastest" w/o the LTO optimization, but hey, that's how things go.
so, for giggles, I then ran "smallest" and "smallest with LTO" and got:
13.72 us
13.64 us
yep, "smallest with LTO" IN MY CASE is faster than "FASTEST with LTO"
the take away message I'd throw out there is:
if speed is king, test your code; don't rely on the compiler's settings.
--mjlg
Space? who cares! I want speed!
So, at the start of the code I throw a pin high and at the end, throw it low and measured it on the o-scope.
going from Fast to Fastest with LTO on every other one I got:
15.56 us
16.36 us
14.44 us
14.28 us
14.52 us
14.12 us
with the last being "Fastest with LTO"
It was funny that "faster" was faster than "fastest" w/o the LTO optimization, but hey, that's how things go.
so, for giggles, I then ran "smallest" and "smallest with LTO" and got:
13.72 us
13.64 us
yep, "smallest with LTO" IN MY CASE is faster than "FASTEST with LTO"
the take away message I'd throw out there is:
if speed is king, test your code; don't rely on the compiler's settings.
--mjlg