buaazp / fasthttprouter

A high performance fasthttp request router that scales well
http://godoc.org/github.com/buaazp/fasthttprouter
BSD 3-Clause "New" or "Revised" License
872 stars 91 forks source link

Avoid string allocation in tree lookup for every request #51

Open gallir opened 5 years ago

gallir commented 5 years ago

path := string() allocates a new string for every call, use the same b2s() function as in fasthttp to avoid the allocation.

coveralls commented 5 years ago

Coverage Status

Coverage increased (+0.008%) to 98.253% when pulling d098ad7638ed1f5fd6f34b33025da28c19b03c15 on gallir:b2s into 979d6e516ec324575737805deabe0303794c58bd on buaazp:master.

savsgio commented 5 years ago

Hi @gallir,

The official fasthttp organization is maintaining this repo in https://github.com/fasthttp/router. It has some improvements and optimizations in performance. I recommend you use it.

Thanks.

savsgio commented 5 years ago

path := string() allocates a new string for every call, use the same b2s() function as in fasthttp to avoid the allocation.

This change is did in official router repository.