Change from Express to a more performant HTTP server dependency
justinkaseman opened this issue · comments
Description
In our EA guild we pinpointed a couple areas where External Adapters could be more performant.
One of these areas is the HTTP server package used to run the EA's API server.
Express is a good choice for its feature richness and high adoption, but our EAs have a very simple API.
We should investigate leveraging a more performance focused package.
A strong candidate is Fastify, which shows a ~4.5x increase in requests per second in profiling, and shares a similar interface as Express.
https://www.fastify.io/benchmarks/
Other options are open for discussion.
An initial spike was carried out in this Pull Request:
https://github.com/smartcontractkit/external-adapters-js/pull/
The work for this ticket can either built on top of that branch (it will need to be re-based at it has gone stale) or repeated in a new branch, as there are not many changes to be made.
The express rate limit code is okay to remove.
Completion of this ticket should include:
- Thought into what edge cases or downsides there may be to moving to a new HTTP server dependency
- Care given to manual acceptance testing of an adapter to ensure that no breaking changes are introduced