()
| 211 | } |
| 212 | |
| 213 | func (b *benchmarkRow) String() string { |
| 214 | pct := func(val, baseline int64) string { |
| 215 | return fmt.Sprintf( |
| 216 | "%+0.f%%", |
| 217 | ((float64(val)/float64(baseline))*100)-100, |
| 218 | ) |
| 219 | } |
| 220 | t := b.Time.Nanoseconds() |
| 221 | tp := pct(t, b.ZapTime.Nanoseconds()) |
| 222 | |
| 223 | return fmt.Sprintf( |
| 224 | "| %s | %d ns/op | %s | %d allocs/op", b.Name, |
| 225 | t, tp, b.AllocatedObjects, |
| 226 | ) |
| 227 | } |
| 228 | |
| 229 | type benchmarkRowsByTime []*benchmarkRow |
| 230 |
no outgoing calls
no test coverage detected