Deno performance compared to node.js
Asked Answered
N

3

8

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?

Niche answered 7/5, 2020 at 16:47 Comment(0)
Y
1

(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
Yolondayon answered 30/7, 2020 at 6:52 Comment(0)
A
9

Deno keeps track of some key performance metrics here: https://deno.land/benchmarks

As far as pre-compilation, it's on the roadmap and tracked in this issue: https://github.com/denoland/deno/issues/986

Anastigmat answered 7/5, 2020 at 18:35 Comment(0)
Y
1

(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
Yolondayon answered 30/7, 2020 at 6:52 Comment(0)
S
-4

Deno performance was and still better than Nodejs in excellent way since it's was using both JavaScript and TypeScript in it's code.

Deno as a secure TypeScript runtime built on V8, the Google runtime engine for JavaScript, is a good hope for back-end devs in future as It was built with Rust which I think is better than C++ which gave a life to Nodejs (Deno’s core was written in Rust, Node’s in C++).

I've not yet started to use deno fully but It's undoubtedly sure that it will be the best alternative to Nodejs as it includes almost everything Nodejs has with additional modern features needed in new dev world.

I'm trying to make it's tutorial on my site #Donnekt

Skin answered 7/5, 2020 at 16:47 Comment(1)
this is literally a lie. There are a lot of benchmarks where nodejs is more performance than deno.Slobbery

© 2022 - 2024 — McMap. All rights reserved.