proost opened a new pull request, #161:
URL: https://github.com/apache/datasketches-go/pull/161

   we can reduce allocating of slices.
   
   If run the escape analysis, 
   
   ```
   count/count_min_sketch.go:97:31: make([]int64, c.numHashes) escapes to heap 
in (*CountMinSketch).getHashes:
   ```
   
   
   
   Before:
   
   ```
   goos: darwin
   goarch: arm64
   pkg: github.com/apache/datasketches-go/count
   cpu: Apple M4 Pro
   BenchmarkCountMinSketch_Update
   BenchmarkCountMinSketch_Update-12            34135192                32.77 
ns/op           24 B/op          1 allocs/op
   PASS
   
   
   goos: darwin
   goarch: arm64
   pkg: github.com/apache/datasketches-go/count
   cpu: Apple M4 Pro
   BenchmarkCountMinSketch_GetEstimate
   BenchmarkCountMinSketch_GetEstimate-12       34794710                32.60 
ns/op           24 B/op          1 allocs/op
   PASS
   ```
   
   
   After:
   
   ```
   goos: darwin
   goarch: arm64
   pkg: github.com/apache/datasketches-go/count
   cpu: Apple M4 Pro
   BenchmarkCountMinSketch_Update
   BenchmarkCountMinSketch_Update-12            45174462                26.34 
ns/op            0 B/op          0 allocs/op
   PASS
   
   goos: darwin
   goarch: arm64
   pkg: github.com/apache/datasketches-go/count
   cpu: Apple M4 Pro
   BenchmarkCountMinSketch_GetEstimate
   BenchmarkCountMinSketch_GetEstimate-12       45396912                26.71 
ns/op            0 B/op          0 allocs/op
   PASS
   ```


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to