Skip to content

Instantly share code, notes, and snippets.

@josharian
Created January 6, 2019 20:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save josharian/5d1340c2f35e3d78ddbef766acf3b929 to your computer and use it in GitHub Desktop.
Save josharian/5d1340c2f35e3d78ddbef766acf3b929 to your computer and use it in GitHub Desktop.
package p
import (
_ "net/http"
"testing"
_ "unsafe"
)
//go:linkname _initdone net/http.initdone·
var _initdone uint8
//go:linkname _init net/http.init
func _init()
func BenchmarkInit(b *testing.B) {
for i := 0; i < b.N; i++ {
_initdone = 0
_init()
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment