Many operations do not pass refs to Write. Similarly adding

...interface{} requires constructing a slice, which is slow.

This cuts about 100ns from RRect and Border benchmark.

Signed-off-by: Egon Elbre <egonelbre@gmail.com>
This commit is contained in:
Egon Elbre
2020-11-23 23:43:17 +01:00
committed by Elias Naur
parent 1899104536
commit 918a5da308
5 changed files with 20 additions and 7 deletions
+1 -1
View File
@@ -24,7 +24,7 @@ type Event struct {
}
func (p Op) Add(o *op.Ops) {
data := o.Write(opconst.TypeProfileLen, p.Tag)
data := o.Write1(opconst.TypeProfileLen, p.Tag)
data[0] = byte(opconst.TypeProfile)
}