benjaminch / pricers

This library supports RTB development for Open RTB common price encryption in Golang.
GNU General Public License v3.0
8 stars 4 forks source link

Optimization #18

Open stokito opened 1 year ago

stokito commented 1 year ago

I going to reuse a pricer instances and put them to a sync.Pool In the same time I receiving the encryptedPrice as []byte so on conversion to string it creates an allocation. Here I extracted a separate method DecodeRaw() that can work directly with []byte. But also it can reuse a buffer and count of allocations significantly reduced. Under a heavy load this is a very good thing