Early results on curve benchmarks #90 show an insane amount of time in runtime.newobject and consequently also in GC.
After some experimentation it became clear that escape analysis was choosing to allocate Add/Double temporaries on the heap because they are passed to the field functions in assembly, which it knows nothing about. Adding //go:noescape manually to the functions below solves the problem and massively improves performance.
Early results on curve benchmarks #90 show an insane amount of time in
runtime.newobject
and consequently also in GC.After some experimentation it became clear that escape analysis was choosing to allocate Add/Double temporaries on the heap because they are passed to the field functions in assembly, which it knows nothing about. Adding
//go:noescape
manually to the functions below solves the problem and massively improves performance.https://github.com/mmcloughlin/ec3/blob/e47ab401d787aceb24bbba12a923c67225f063df/examples/p256/fp_amd64.go#L3-L11
Need to ensure the
noescape
directive is added to all these function stubs. Depends on mmcloughlin/avo#15.