N
N
Nadim Zakirov2021-01-25 13:28:39
JavaScript
Nadim Zakirov, 2021-01-25 13:28:39

Where does JavaScript run faster: in the browser or in NodeJS?

Does NodeJS have a speed advantage when executing JavaScript code? Or is the browser engine still more optimized? I want to understand where it is more profitable in terms of time to carry out complex mathematical calculations, on the front in the browser or on the backend in NodeJS?

Why is it needed
Буду писать сложное приложение на Electron, ну и пока не определился куда выносить всю основную логику приложения в вместе с расчётами: на NodeJS бэкенд или просто в браузере все считать? В плане расчетов будет разбор больших объемов текстов при помощи регулярных выражений / DOMParser() + вычисление различных хешей по ГОСТ алгоритмам.

Answer the question

In order to leave comments, you need to log in

6 answer(s)
L
Lynn "Coffee Man", 2021-01-25
@Lynn

Considering that both there and there under the hood the same V8 question is meaningless.
Unless, of course, you understand by browser (like most) Chrome and its clones.
Firefox has a different engine, but in this case it is more correct to compare V8 vs SpiderMonkey.

D
Dmitry, 2021-01-25
@dimoff66

Browsers are different. They work on different devices with different technical characteristics, therefore the question does not make any sense without specifying which browser is meant and on which device it will be launched.
Also, the expression "complex mathematical calculations" is not very clear. What is meant by "complexity"? Are they running for a long time? Take up a lot of RAM? How often are they performed?

2
2CHEVSKII, 2021-01-25
@2chevskii

Node has a browser engine . Node - basically just an IO wrapper for v8

R
Ranwise, 2021-01-25
@Ranwise

js parsing/parsing is just one of the tasks of the browser before rendering pages and executing them on the page,
read something about browser work https://developer.mozilla.org/ru/docs/Web/Performa...

A
acwartz, 2021-01-26
@acwartz

I want to understand where it is more profitable in terms of time to carry out complex mathematical calculations,

In C++, CUDA is the most profitable and fastest. If you can't use CUDA then at least just C++.

R
Roman Kitaev, 2021-01-26
@deliro

I want to understand where it is more profitable in terms of time to carry out complex mathematical calculations, on the front in the browser or on the backend in NodeJS?

In python with numpy, pandas, numba and co.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question