Does enabling `nodejs_compat` in Cloudflare Workers slow down the worker's performance?
Is there any performance impact?
4 Replies
There shouldn't be.
As Node.js adds some extra overhead, why is there not a performance issue?
Workers never run Node.js
It's just some modules added into the runtime
https://github.com/cloudflare/workerd/tree/main/src/node
node_compat option in wrangler polyfills/adds a bunch of stuff to your bundle, which would slow down loading and such, but for nodejs_compat flag the modules are already there in the runtime, just not enabled.