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
I don't think this is specifically caused by the zero-length field. It's just that structures with more than 4 fields are not ssa-able. If you change scalar to
type Scalar struct {
XX int
A, B *int
C, D uint64
}
Using
go1.10.1
Consider the following benchmark:
One my machine, this takes:
which is an abnormally high amount of time to copy 32 bytes.
If you comment out the
incomparable
field, the benchmarks dramatically improves:I don't quite see how a zero-length field could make such a big impact of performance.
The assembly for BenchmarkB (with
incomparable
):The assembly for BenchmarkA (with
incomparable
):The assembly for both BenchmarkA and BenchmarkB (without
incomparable
):The presence of the
incomparable
field seems to trigger the use ofruntime.duffcopy
, which is slow on short copies.The text was updated successfully, but these errors were encountered: