Comparing performance of Express and Effect HttpServer implementations
What is the overhead of
@effect/platform/HttpServer
@effect/platform/HttpServer
? Am I doing something wrong wih how I create my HttpServer.
I tried to create a simple HttpServer to see what Effect capable of and how fast it is. I compared Express to Effect and here are the results Express (1. screenshot) and Effect (2. screenshot).
Express:
import express from 'express'import { Effect } from 'effect';import { NodeRuntime } from '@effect/platform-node';const mainProgram = Effect.sync(() => { const app = express() const port = 3000 app.get('/', (req, res) => { res.json({ hello: "world" }) }) app.listen(port, () => { console.log(`Example app listening on port ${port}`) })})NodeRuntime.runMain(mainProgram)
import express from 'express'import { Effect } from 'effect';import { NodeRuntime } from '@effect/platform-node';const mainProgram = Effect.sync(() => { const app = express() const port = 3000 app.get('/', (req, res) => { res.json({ hello: "world" }) }) app.listen(port, () => { console.log(`Example app listening on port ${port}`) })})NodeRuntime.runMain(mainProgram)