github.com/egonelbre/exp@v0.0.0-20240430123955-ed1d3aa93911/bench/vector/go1.14.summary.md (about) 1 # Shorthands 2 3 Definitions for the funcs: 4 5 ``` 6 func (a *V) PP_Add(b *V) { a.X += b.X; a.Y += b.Y; a.Z += b.Z } 7 func (a *V) PN_Add(b V) { a.X += b.X; a.Y += b.Y; a.Z += b.Z } 8 func (a *V) PPP_Add(b *V) *V { return &V{a.X + b.X, a.Y + b.Y, a.Z + b.Z} } 9 func (a V) NNN_Add(b V) V { return V{a.X + b.X, a.Y + b.Y, a.Z + b.Z} } 10 func (a *V) PPN_Add(b *V) V { return V{a.X + b.X, a.Y + b.Y, a.Z + b.Z} } 11 func (a *V) PNP_Add(b V) *V { return &V{a.X + b.X, a.Y + b.Y, a.Z + b.Z} } 12 func (a V) NPP_Add(b *V) *V { return &V{a.X + b.X, a.Y + b.Y, a.Z + b.Z} } 13 func (a V) NNP_Add(b V) *V { return &V{a.X + b.X, a.Y + b.Y, a.Z + b.Z} } 14 func (a V) NPN_Add(b *V) V { return V{a.X + b.X, a.Y + b.Y, a.Z + b.Z} } 15 func (a *V) PNN_Add(b V) V { return V{a.X + b.X, a.Y + b.Y, a.Z + b.Z} } 16 17 func (a *V) PPZ_Add(b *V, r *V) { *r = V{a.X + b.X, a.Y + b.Y, a.Z + b.Z} } 18 func (a V) NPZ_Add(b *V, r *V) { *r = V{a.X + b.X, a.Y + b.Y, a.Z + b.Z} } 19 func (a *V) PNZ_Add(b V, r *V) { *r = V{a.X + b.X, a.Y + b.Y, a.Z + b.Z} } 20 func (a V) NNZ_Add(b V, r *V) { *r = V{a.X + b.X, a.Y + b.Y, a.Z + b.Z} } 21 22 func (a *V) PPY_Add(b *V, r *V) { r.X = a.X + b.X; r.Y = a.Y + b.Y; r.Z = a.Z + b.Z } 23 func (a V) NPY_Add(b *V, r *V) { r.X = a.X + b.X; r.Y = a.Y + b.Y; r.Z = a.Z + b.Z } 24 func (a *V) PNY_Add(b V, r *V) { r.X = a.X + b.X; r.Y = a.Y + b.Y; r.Z = a.Z + b.Z } 25 func (a V) NNY_Add(b V, r *V) { r.X = a.X + b.X; r.Y = a.Y + b.Y; r.Z = a.Z + b.Z } 26 ``` 27 # float32 28 29 ## struct 30 31 ``` 32 Add_PP_V32s3-32 2.67ns ± 0% 33 Add_PN_V32s3-32 2.65ns ± 0% 34 Add_PPP_V32s3-32 2.65ns ± 0% 35 Add_NNN_V32s3-32 0.72ns ± 0% 36 Add_PPN_V32s3-32 2.66ns ± 1% 37 Add_PNP_V32s3-32 2.65ns ± 0% 38 Add_NPP_V32s3-32 0.73ns ± 1% 39 Add_NNP_V32s3-32 0.72ns ± 0% 40 Add_NPN_V32s3-32 0.73ns ± 1% 41 Add_PNN_V32s3-32 2.64ns ± 0% 42 43 Add_PPZ_V32s3-32 2.64ns ± 0% 44 Add_NPZ_V32s3-32 2.67ns ± 0% 45 Add_PNZ_V32s3-32 2.65ns ± 0% 46 Add_NNZ_V32s3-32 2.65ns ± 1% 47 48 Add_PPY_V32s3-32 2.64ns ± 0% 49 Add_NPY_V32s3-32 2.65ns ± 0% 50 Add_PNY_V32s3-32 2.64ns ± 0% 51 Add_NNY_V32s3-32 2.64ns ± 0% 52 ``` 53 54 ## array 55 56 ``` 57 Add_PP_V32a3-32 2.65ns ± 0% 58 Add_PN_V32a3-32 2.71ns ± 0% 59 Add_PPP_V32a3-32 2.65ns ± 0% 60 Add_NNN_V32a3-32 10.7ns ± 1% 61 Add_PPN_V32a3-32 8.16ns ± 0% 62 Add_PNP_V32a3-32 2.74ns ± 0% 63 Add_NPP_V32a3-32 7.30ns ± 1% 64 Add_NNP_V32a3-32 7.24ns ± 0% 65 Add_NPN_V32a3-32 9.88ns ± 0% 66 Add_PNN_V32a3-32 8.56ns ± 0% 67 68 Add_PPZ_V32a3-32 2.66ns ± 1% 69 Add_NPZ_V32a3-32 7.32ns ± 0% 70 Add_PNZ_V32a3-32 2.72ns ± 0% 71 Add_NNZ_V32a3-32 7.33ns ± 1% 72 73 Add_PPY_V32a3-32 2.66ns ± 0% 74 Add_NPY_V32a3-32 7.36ns ± 1% 75 Add_PNY_V32a3-32 2.75ns ± 0% 76 Add_NNY_V32a3-32 8.48ns ± 0% 77 ``` 78 79 # float64 80 81 ## struct 82 83 ``` 84 Add_PP_V64s3-32 2.65ns ± 0% 85 Add_PN_V64s3-32 2.65ns ± 0% 86 Add_PPP_V64s3-32 2.65ns ± 0% 87 Add_NNN_V64s3-32 0.73ns ± 0% 88 Add_PPN_V64s3-32 2.66ns ± 0% 89 Add_PNP_V64s3-32 2.65ns ± 0% 90 Add_NPP_V64s3-32 0.73ns ± 0% 91 Add_NNP_V64s3-32 0.72ns ± 0% 92 Add_NPN_V64s3-32 0.73ns ± 0% 93 Add_PNN_V64s3-32 2.65ns ± 0% 94 95 Add_PPZ_V64s3-32 2.65ns ± 0% 96 Add_NPZ_V64s3-32 2.65ns ± 0% 97 Add_PNZ_V64s3-32 2.65ns ± 0% 98 Add_NNZ_V64s3-32 2.66ns ± 0% 99 100 Add_PPY_V64s3-32 2.66ns ± 0% 101 Add_NPY_V64s3-32 2.70ns ± 0% 102 Add_PNY_V64s3-32 2.66ns ± 0% 103 Add_NNY_V64s3-32 2.66ns ± 0% 104 ``` 105 106 ## array 107 108 ``` 109 Add_PP_V64a3-32 2.66ns ± 0% 110 Add_PN_V64a3-32 2.67ns ± 0% 111 Add_PPP_V64a3-32 2.65ns ± 0% 112 Add_NNN_V64a3-32 9.91ns ± 0% 113 Add_PPN_V64a3-32 8.67ns ± 0% 114 Add_PNP_V64a3-32 2.71ns ± 0% 115 Add_NPP_V64a3-32 9.14ns ± 0% 116 Add_NNP_V64a3-32 9.15ns ± 0% 117 Add_NPN_V64a3-32 9.84ns ± 0% 118 Add_PNN_V64a3-32 8.23ns ± 0% 119 120 Add_PPZ_V64a3-32 2.66ns ± 1% 121 Add_NPZ_V64a3-32 9.18ns ± 0% 122 Add_PNZ_V64a3-32 2.69ns ± 0% 123 Add_NNZ_V64a3-32 9.17ns ± 0% 124 125 Add_PPY_V64a3-32 2.66ns ± 0% 126 Add_NPY_V64a3-32 8.69ns ± 0% 127 Add_PNY_V64a3-32 2.68ns ± 0% 128 Add_NNY_V64a3-32 7.30ns ± 0% 129 ```