Search code examples
node.jsperformancev8deno

Deno performance compared to node.js


Deno uses v8 to execute javascript but considering the fact that it directly runs typescript, I'm wondering if there is a performance penalty because of it or not.

It seems it compiles the code only for the first time. So is it possible to compile as a deployment step and avoid the startup overhead related to compilation?

Is there any other aspect in performance comparison between node.js and Deno?


Solution

  • (an answer to the 2nd paragraph)

    Deno stores the compiled assets in DENO_DIR. You can check it with the command "deno info". If you deploy the entire DENO_DIR as well as your source code, you can avoid the TypeScript compilation at the startup time.

    You can also change the location of DENO_DIR by setting the DENO_DIR environmental variable.

    DENO_DIR=/path/to/your_deno_dir deno run entrypoint.ts