MCPcopy
hub / github.com/bnb-chain/bsc / BenchmarkEncodeBigInts

Function BenchmarkEncodeBigInts

rlp/encode_test.go:527–542  ·  view source on GitHub ↗
(b *testing.B)

Source from the content-addressed store, hash-verified

525}
526
527func BenchmarkEncodeBigInts(b *testing.B) {
528 ints := make([]*big.Int, 200)
529 for i := range ints {
530 ints[i] = math.BigPow(2, int64(i))
531 }
532 out := bytes.NewBuffer(make([]byte, 0, 4096))
533 b.ResetTimer()
534 b.ReportAllocs()
535
536 for i := 0; i < b.N; i++ {
537 out.Reset()
538 if err := Encode(out, ints); err != nil {
539 b.Fatal(err)
540 }
541 }
542}
543
544func BenchmarkEncodeU256Ints(b *testing.B) {
545 ints := make([]*uint256.Int, 200)

Callers

nothing calls this directly

Calls 4

BigPowFunction · 0.92
FatalMethod · 0.80
EncodeFunction · 0.70
ResetMethod · 0.65

Tested by

no test coverage detected