You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@datasketches.apache.org by "proost (via GitHub)" <gi...@apache.org> on 2025/12/10 11:05:04 UTC

[PR] perf: use sentinel error for theta sketch hashtable. [datasketches-go]

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

   Go vs Java benchmark: https://github.com/apache/datasketches-characterization/pull/89
   
   code:
   
   ```go
   func BenchmarkHashAndScreen(b *testing.B) {
   	b.Run("most hashes passes", func(b *testing.B) {
   		ht := NewHashtable(10, 10, ResizeX2, 1.0, MaxTheta, DefaultSeed, true)
   		b.ReportAllocs()
   		b.ResetTimer()
   		for i := 0; i < b.N; i++ {
   			_, _ = ht.HashInt64AndScreen(int64(i))
   		}
   	})
   
   	b.Run("hashes exceed theta", func(b *testing.B) {
   		ht := NewHashtable(10, 10, ResizeX2, 0.001, 1000, DefaultSeed, true)
   		b.ReportAllocs()
   		b.ResetTimer()
   		for i := 0; i < b.N; i++ {
   			_, _ = ht.HashInt64AndScreen(int64(i))
   		}
   	})
   }
   ```
   
   
   
   * current code performance:
   
   ```
   goos: darwin
   goarch: arm64
   pkg: github.com/apache/datasketches-go/theta
   cpu: Apple M1 Pro
   BenchmarkHashAndScreen
   BenchmarkHashAndScreen/most_hashes_passes
   BenchmarkHashAndScreen/most_hashes_passes-10         	240147729	         5.022 ns/op	       0 B/op	       0 allocs/op
   BenchmarkHashAndScreen/hashes_exceed_theta
   BenchmarkHashAndScreen/hashes_exceed_theta-10        	 9001977	       132.9 ns/op	      96 B/op	       4 allocs/op
   ```
   
   * changed:
   
   ```
   goos: darwin
   goarch: arm64
   pkg: github.com/apache/datasketches-go/theta
   cpu: Apple M1 Pro
   BenchmarkHashAndScreen
   BenchmarkHashAndScreen/most_hashes_passes
   BenchmarkHashAndScreen/most_hashes_passes-10         	241465656	         4.943 ns/op	       0 B/op	       0 allocs/op
   BenchmarkHashAndScreen/hashes_exceed_theta
   BenchmarkHashAndScreen/hashes_exceed_theta-10        	246932887	         4.860 ns/op	       0 B/op	       0 allocs/op
   ```
   
   Sorry for not considering performance in hot path when i wrote code and Thank you for accepting breaking change. 
   
   
   


-- 
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: dev-unsubscribe@datasketches.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@datasketches.apache.org
For additional commands, e-mail: dev-help@datasketches.apache.org


Re: [PR] perf: use sentinel error for theta sketch hashtable. [datasketches-go]

Posted by "freakyzoidberg (via GitHub)" <gi...@apache.org>.
freakyzoidberg commented on PR #71:
URL: https://github.com/apache/datasketches-go/pull/71#issuecomment-3636700874

   Don't be sorry, thanks for the time you put into this!


-- 
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: dev-unsubscribe@datasketches.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@datasketches.apache.org
For additional commands, e-mail: dev-help@datasketches.apache.org


Re: [PR] perf: use sentinel error for theta sketch hashtable. [datasketches-go]

Posted by "freakyzoidberg (via GitHub)" <gi...@apache.org>.
freakyzoidberg merged PR #71:
URL: https://github.com/apache/datasketches-go/pull/71


-- 
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: dev-unsubscribe@datasketches.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@datasketches.apache.org
For additional commands, e-mail: dev-help@datasketches.apache.org