mirror of https://github.com/golang/go.git
For some types where the zero value is a value where all bits of this type are 0
optimize it
goos: windows
goarch: amd64
pkg: reflect
cpu: AMD Ryzen 7 7840HS w/ Radeon 780M Graphics
│ std.txt │ new.txt │
│ sec/op │ sec/op vs base │
IsZero/ArrayComparable-16 8.483n ± 0% 8.470n ± 2% ~ (p=0.542 n=10)
IsZero/ArrayIncomparable-16 88.13n ± 1% 87.34n ± 2% ~ (p=0.110 n=10)
IsZero/StructComparable-16 4.050n ± 2% 4.011n ± 1% ~ (p=0.093 n=10)
IsZero/StructIncomparable-16 19.93n ± 1% 19.81n ± 1% ~ (p=0.493 n=10)
IsZero/ArrayInt_4-16 4.445n ± 2% 4.478n ± 2% ~ (p=0.306 n=10)
IsZero/ArrayInt_1024-16 3381.5n ± 3% 140.8n ± 1% -95.84% (p=0.000 n=10)
IsZero/ArrayInt_1024_NoZero-16 1760.50n ± 3% 72.17n ± 1% -95.90% (p=0.000 n=10)
IsZero/Struct4Int-16 4.495n ± 3% 4.478n ± 1% ~ (p=0.579 n=10)
IsZero/ArrayStruct4Int_1024-16 1404.0n ± 3% 140.5n ± 0% -90.00% (p=0.000 n=10)
IsZero/ArrayChanInt_1024-16 3437.0n ± 6% 140.5n ± 1% -95.91% (p=0.000 n=10)
geomean 89.94n 27.38n -69.56%
Change-Id: I835231a79b9cd89686d44c5b8c2fbe629ccd98ba
GitHub-Last-Rev:
|
||
|---|---|---|
| .. | ||
| internal | ||
| abi.go | ||
| abi_test.go | ||
| all_test.go | ||
| arena.go | ||
| asm_386.s | ||
| asm_amd64.s | ||
| asm_arm.s | ||
| asm_arm64.s | ||
| asm_loong64.s | ||
| asm_mips64x.s | ||
| asm_mipsx.s | ||
| asm_ppc64x.s | ||
| asm_riscv64.s | ||
| asm_s390x.s | ||
| asm_wasm.s | ||
| benchmark_test.go | ||
| deepequal.go | ||
| example_test.go | ||
| export_test.go | ||
| float32reg_generic.go | ||
| float32reg_ppc64x.s | ||
| float32reg_riscv64.s | ||
| makefunc.go | ||
| nih_test.go | ||
| set_test.go | ||
| stubs_ppc64x.go | ||
| stubs_riscv64.go | ||
| swapper.go | ||
| tostring_test.go | ||
| type.go | ||
| type_test.go | ||
| value.go | ||
| visiblefields.go | ||
| visiblefields_test.go | ||