118

记fastHTTP协程池的实现 | nino's blog

 6 years ago
source link: https://ninokop.github.io/2018/03/20/%E8%AE%B0fastHTTP%E5%8D%8F%E7%A8%8B%E6%B1%A0%E7%9A%84%E5%AE%9E%E7%8E%B0/?
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
golang的net/http包实现了处理连接时比较简单粗暴,相比之下有性能更好的http库,项目里用到过的fasthttp就是一个很好的实现,Go开发HTTP的另一个选择fasthttp中总结了它跟标准库实现的几点不同: net/http 的实现是一个连接新建一个 goroutine,fasthttp 是利用一个 worker pool做了协程池,复用 goroutine,减轻 runtim

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK