xssnick / tonutils-go

TON SDK Library in pure Golang for interacting with The Open Network ecosystem using native protocols, such as ADNL, RLDP and etc.
Apache License 2.0
535 stars 108 forks source link

Heavy vector octet optimizations #148

Closed andreypfau closed 11 months ago

andreypfau commented 11 months ago

Old version:

Benchmark_EncodeDecodeFuzz-10         1790     611783 ns/op   652920 B/op     1810 allocs/op
Benchmark_EncodeDecodeFuzz-10         1803     600854 ns/op   652919 B/op     1810 allocs/op
Benchmark_EncodeDecodeFuzz-10         1818     619967 ns/op   652914 B/op     1809 allocs/op

New version:

Benchmark_EncodeDecodeFuzz-10         4076     252432 ns/op   652919 B/op     1810 allocs/op
Benchmark_EncodeDecodeFuzz-10         4021     272682 ns/op   652918 B/op     1810 allocs/op
Benchmark_EncodeDecodeFuzz-10         4015     252178 ns/op   652919 B/op     1810 allocs/op

Result: ~ +125% perfomance increase