Created
April 4, 2017 06:54
-
-
Save vosst/cb3d16e1f1596baf6ccb989d6b1897a7 to your computer and use it in GitHub Desktop.
Profiling Go's RSA key generation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"crypto/rand" | |
"crypto/rsa" | |
"os" | |
"runtime/pprof" | |
) | |
func main() { | |
f, err := os.Create("rsa_cpu_profile") | |
if err != nil { | |
panic(err) | |
} | |
pprof.StartCPUProfile(f) | |
defer pprof.StopCPUProfile() | |
_, err = rsa.GenerateKey(rand.Reader, 4096) | |
if err != nil { | |
panic(err) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment