-
Notifications
You must be signed in to change notification settings - Fork 5.2k
Description
As discussed in this comment the inliner currently does not inline some performance critical code in the SHA512 algorithm. I'll reproduce the picture here:
RotateRight seems like a clear inlining candidate. The sigma* functions less clear but would be beneficial.
Since this is extremely performance critical code I think [MethodImpl(MethodImplOptions.AggressiveInlining)] should be applied as a fix.
I'll also quote an idea to improve the inliner heuristics:
Maybe the heuristics can be tweaked. Just throwing the idea out there: Increase inlining probability when the candidate has no control flow (for some practical definition of control flow). Also increase it if there is at least one constant argument. Also increase it if there is no memory access.
Update: Also increase of there are no allocations, no exception handling and no exceptions raised.
category:cq
theme:inlining
skill-level:expert
cost:large