1
0
mirror of https://github.com/golang/go synced 2024-10-04 06:21:23 -06:00
Commit Graph

2 Commits

Author SHA1 Message Date
Luuk van Dijk
2c4edb0eea gc: make merely referencing an outer variable in a closure not force heapallocation.
before: runtime_test.BenchmarkCallClosure1       20000000              135 ns/op
after:  runtime_test.BenchmarkCallClosure1      500000000                6 ns/op

R=rsc
CC=golang-dev
https://golang.org/cl/4527091
2011-06-01 17:02:43 +02:00
Luuk van Dijk
9b82408f6d gc: elide call to runtime.closure for function literals called in-place.
before:
runtime_test.BenchmarkCallClosure        5000000               499 ns/op
runtime_test.BenchmarkCallClosure1       5000000               681 ns/op

after:
runtime_test.BenchmarkCallClosure       500000000                5 ns/op
runtime_test.BenchmarkCallClosure1       10000000              160 ns/op

R=rsc
CC=golang-dev
https://golang.org/cl/4515167
2011-05-31 20:52:21 +02:00