fix: resolve benchmark and build tag conflicts
- Remove duplicate hash_selector.go (build tags handle switching) - Fix benchmark to use worker.DirOverallSHA256Hex - Fix snapshot_store.go to use integrity.DirOverallSHA256Hex directly - Native tests pass, benchmarks now correctly test native vs Go
This commit is contained in:
parent
90d702823b
commit
158c525bef
3 changed files with 3 additions and 21 deletions
|
|
@ -1,19 +0,0 @@
|
|||
package worker
|
||||
|
||||
import (
|
||||
"github.com/jfraeys/fetch_ml/internal/worker/integrity"
|
||||
)
|
||||
|
||||
// dirOverallSHA256Hex uses native implementation when compiled with -tags native_libs.
|
||||
// The build tag selects between native_bridge.go (stub) and native_bridge_libs.go (real).
|
||||
// No runtime configuration needed - build determines behavior.
|
||||
func dirOverallSHA256Hex(root string) (string, error) {
|
||||
// native_bridge_libs.go provides this when built with -tags native_libs
|
||||
// native_bridge.go provides stub that falls back to Go
|
||||
return dirOverallSHA256HexNative(root)
|
||||
}
|
||||
|
||||
// DirOverallSHA256HexParallel exports the parallel directory hashing function.
|
||||
func DirOverallSHA256HexParallel(root string) (string, error) {
|
||||
return integrity.DirOverallSHA256HexParallel(root)
|
||||
}
|
||||
|
|
@ -173,7 +173,7 @@ func ResolveSnapshot(
|
|||
return "", err
|
||||
}
|
||||
|
||||
got, err := dirOverallSHA256Hex(extractDir)
|
||||
got, err := integrity.DirOverallSHA256Hex(extractDir)
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
|
|
|
|||
|
|
@ -48,7 +48,8 @@ func BenchmarkDatasetSizeComparison(b *testing.B) {
|
|||
b.ResetTimer()
|
||||
b.ReportAllocs()
|
||||
for i := 0; i < b.N; i++ {
|
||||
_, err := worker.DirOverallSHA256HexParallel(tmpDir)
|
||||
// Use DirOverallSHA256Hex which calls native via build tag
|
||||
_, err := worker.DirOverallSHA256Hex(tmpDir)
|
||||
if err != nil {
|
||||
b.Fatal(err)
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue