Skip to content

Commit

Permalink
Add AppendInt function with positive/negative number convertion to st…
Browse files Browse the repository at this point in the history
…ring

Benchmark_ItoA/fiber             (pos_num)-12  190428255        6.13 ns/op       0 B/op       0 allocs/op
Benchmark_ItoA/fiber             (pos_num)-12  196626811        6.08 ns/op       0 B/op       0 allocs/op
Benchmark_ItoA/strconv.Itoa      (pos_num)-12   80716807       14.33 ns/op       4 B/op       1 allocs/op
Benchmark_ItoA/strconv.Itoa      (pos_num)-12   80445802       14.30 ns/op       4 B/op       1 allocs/op
Benchmark_ItoA/strconv.FormatInt_(pos_num)-12   81137728       14.30 ns/op       4 B/op       1 allocs/op
Benchmark_ItoA/strconv.FormatInt_(pos_num)-12   81345360       14.49 ns/op       4 B/op       1 allocs/op
Benchmark_ItoA/fiber             (neg_num)-12  151121002        7.81 ns/op       0 B/op       0 allocs/op
Benchmark_ItoA/fiber             (neg_num)-12  153566410        7.70 ns/op       0 B/op       0 allocs/op
Benchmark_ItoA/strconv.Itoa      (neg_num)-12   84505304       13.75 ns/op       5 B/op       1 allocs/op
Benchmark_ItoA/strconv.Itoa      (neg_num)-12   82524801       13.76 ns/op       5 B/op       1 allocs/op
Benchmark_ItoA/strconv.FormatInt (neg_num)-12   84884136       13.88 ns/op       5 B/op       1 allocs/op
Benchmark_ItoA/strconv.FormatInt (neg_num)-12   85829492       13.76 ns/op       5 B/op       1 allocs/op
  • Loading branch information
ReneWerner87 committed Jul 21, 2024
1 parent 87790b8 commit 9c0bea3
Showing 1 changed file with 0 additions and 13 deletions.
13 changes: 0 additions & 13 deletions convert_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -259,19 +259,6 @@ func Benchmark_ToString(b *testing.B) {
}
}

func Benchmark_ToString_string(b *testing.B) {
res := ""
expectedRes := "4242"
b.ReportAllocs()
b.ResetTimer()

for i := 0; i < b.N; i++ {
res = ToString(4242)
}

require.Equal(b, expectedRes, res)
}

// go test -v -run=^$ -bench=ToString_concurrency -benchmem -count=4
func Benchmark_ToString_concurrency(b *testing.B) {
for _, value := range dataTypeExamples {
Expand Down

0 comments on commit 9c0bea3

Please sign in to comment.