0

When TypeScript is properly strictly typed throughout an application it can compile to Web Assembly.

What are the performance benefits of running your server as a WebAssembly binary vs a running NodeJS server process?

3
  • 1
    this seems overly broad -- what are the relative runtime sizes? You could probably write a book on this topic Commented Feb 26, 2020 at 3:54
  • It is very broad of a question. Would be great to start the conversation. @picklerick Commented Feb 26, 2020 at 3:59
  • That can hardly be answered here since it's too broad, but if i would guess, the benefits would be negligible, Node V8 engine is highly optimized. Keep in mind that if you need to squeeze that much performance(Wich would raise questions on why do you need that on a web-server) to the point were you're asking this, you probably shouldn't be using NodeJS and should use something on lower-levels. Commented Feb 26, 2020 at 4:15

2 Answers 2

1

What are the performance benefits of running your server as a WebAssembly binary vs a running NodeJS server process

Note that WebAssembly still needs to run in a container. The current WebAssembly containers are browsers and node

Correct Question

So the question really is What is the performance advantage of WebAssembly over JavaScript.

Answer

Performance benefits of WebAssembly over JavaScript are covered all over the internet.

Key Reason:

WebAssembly is much closer to hardware level programming.

Levels of proramming langauges:

i.e. Webassembly is low level: https://en.wikipedia.org/wiki/Low-level_programming_language and JavaScript is higher level : https://en.wikipedia.org/wiki/High-level_programming_language and therefore has overheads.

Sign up to request clarification or add additional context in comments.

Comments

1

You can't do I/O from WebAssembly. It is for computation.

You send data into it via a Memory buffer, and get back a memory buffer. See the JS API sample in the docs.

You could use it for a crypto module in a webserver, but not for most of the stuff that the server does.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.