Skip to content

Commit dca67e5

Browse files
rathanndsnet
authored andcommitted
Fix bench test on 32-bit architectures (#64)
1 parent a0360d3 commit dca67e5

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

internal/tool/bench/benchmarks.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ func benchmarkSuite(codecs []string, files []file, levels, sizes []int, tick fun
164164
b = testutil.ResizeData(b, n)
165165
}
166166
fname := strings.Replace(f.Rel, string(filepath.Separator), "_", -1)
167-
name := fmt.Sprintf("%s:%d:%s", fname, l, intName(len(b)))
167+
name := fmt.Sprintf("%s:%d:%s", fname, l, intName(int64(len(b))))
168168
for j, c := range codecs {
169169
if tick != nil {
170170
tick()

internal/tool/bench/config.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,7 @@ func (vs *varStrings) Set(ss string) error {
252252
func (ds *varInts) String() string {
253253
var ss []string
254254
for _, d := range *ds {
255-
ss = append(ss, intName(d))
255+
ss = append(ss, intName(int64(d)))
256256
}
257257
return strings.Join(ss, ",")
258258
}
@@ -272,7 +272,7 @@ func (ds *varInts) Set(ss string) error {
272272
// It uses scientific notation for exact powers of 10.
273273
// It uses SI suffixes for powers of 1024.
274274
// If the number is small enough, it will be printed as is.
275-
func intName(n int) string {
275+
func intName(n int64) string {
276276
switch n {
277277
case 1e3, 1e4, 1e5, 1e6, 1e7, 1e8, 1e9, 1e10, 1e11, 1e12:
278278
s := fmt.Sprintf("%e", float64(n))

0 commit comments

Comments
 (0)