@corona10 you're certainly welcome to take a look, but if you're looking for low-hanging fruit issues to work on, this isn't a good candidate. It likely requires someone with a good understanding of the compiler, and it's not a simple fix, as @josharian already gave that a try.
@mvdan
Oh.. @josharian already tried it. Looks like a not simple issue.
I thought it was just an issue of rewriting so that it can help the compiler to do a mid stack inlining, but I did not know that cost was an issue to consider. I will try to find some easier issues.
We manually partially inline utf8.DecodeRune in a few places in the tree. For example, in
bytes.EqualFold
, we have:It'd be nice to rewrite
utf8.DecodeRune
like this:and then let mid-stack inlining take it from there. (And delete all the manual partial inlining.)
Unfortunately, this has a cost of 89, over the budget of 80.
This is basically just another variant of #17566, but I'm filing it separately since that issue is super noisy.
cc @bradfitz @mvdan @dr2chase
The text was updated successfully, but these errors were encountered: