fasthttp, golang web programming, web framework

fasthttp

Reuse of work coroutine:

and the connection between the worker coroutine coroutine via a communication channel, the internal maintains a list of channel ready state,
after receiving a new connection coroutine conn, found idle channel, the channel is connected through to the corresponding worker,
worker co After processing the current connection, the process returns the channel to the free list and waits for the next request.

Memory variable reuse:

Fasthttp uses a lot of sync.Pool internally, which saves a lot of memory application overhead for variables used multiple times.
Take RequestCtx as an example. At the beginning of each request, first look for reusable ctx variables in ctxPool. , Return the variable to the Pool;

fasthttp comes with benchmark;

Guess you like

Origin blog.csdn.net/MENCO_/article/details/109157785