|
|
|
|
|
by mcv
1032 days ago
|
|
I would agree, but it's hard to argue with a factor 2 performance boost. But these kind of tricks feel like we need to con the compiler into optimising this correctly, which is of course ridiculous. What we probably need instead is if-statements that we can tell what's most likely the correct prediction. Something like: if v > maxV predict true
maxV = v
continue
|
|
So really you end up having to make assumptions about the input to get the performance boost.