thriftrw / thriftrw-go

A Thrift encoding code generator and library for Go
MIT License
101 stars 53 forks source link

Optimise ReadString() #573

Closed saurabhagrawal-86 closed 1 year ago

saurabhagrawal-86 commented 1 year ago

Optimise ReadString() CPU by ~30%

name          old time/op  new time/op  delta
ReadString    90.4ns ± 4%  63.1ns ± 5%  -30.13%  (p=0.008 n=5+5)
ReadString-2   103ns ±10%    68ns ± 7%  -33.31%  (p=0.008 n=5+5)
ReadString-4   109ns ± 7%    79ns ±29%  -27.92%  (p=0.008 n=5+5)