[go-nuts] Perfomance - sha256 Encoding to Hex

2017-10-17 Thread Dave Cheney
The answer to your question is to profile your function. You can do this by writing a standard testing.B benchmark which will give you access to Go’s profiling tools more or less for free. -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To uns

[go-nuts] Perfomance - sha256 Encoding to Hex

2017-10-17 Thread Christian LeMoussel
I need to calculate 10 millions of sha256 checksums, Actually I do this : var bl int var pnb = make([]byte, 10) var hash = [32]byte var sha256Hash string var steps = 1000 startBench := time.Now() for i := 0; i < steps; i++ { bl = 0 bl += copy(pnb[bl:], "TEST") bl += copy(nonce