Better HN
topnewbestaskshowjobs
Log inSign up

jossctz

2 karma · joined Nov 23, 2017 (9y ago) · 2 submissions

Submissions

comment 8y ago · link · parent

Note that you can also get the number of bytes processed per second by calling the SetBytes method. This is very useful on some bench (hashing, base64, ...):

  func benchmarkHash(b *testing.B, h hash.Hash) {
  	data := make([]byte, 1024)
  	rand.Read(data)  
  
  	b.ResetTimer()
  	b.SetBytes(len(data))
  	for n := 0; n < b.N; n++ {
  		h.Write(data)
  		h.Sum(nil)
  	}
  }

2.

Security problems of Kops default deployments(medium.com ↗)

2 points · by jossctz · 9y ago · discuss