You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The custom assembly used most of the time, but 5% of cycles still went to the division of len(s)/d on every iteration. I thought this was an optimization breaking down because it thought len(s) might change, but it turns out not to depend on slices at all.
https://play.golang.org/p/RxXnFIJqtcj
loop
compiles to:PCs 13-15 (IMULQ and associated loads) could be hoisted out of the loop to avoid re-computing the product on every iteration.
The original motivation of this issue is from an application I was profiling with a hot path something like:
The custom assembly used most of the time, but 5% of cycles still went to the division of
len(s)/d
on every iteration. I thought this was an optimization breaking down because it thoughtlen(s)
might change, but it turns out not to depend on slices at all.cc @randall77 @dr2chase @mdempsky
Potentially related to or duplicate of #15808.
The text was updated successfully, but these errors were encountered: