Sharkbench

Benchmarking programming languages and web frameworks

JavaScript Computation Benchmark

About JavaScript

Paradigm

Object-Oriented, Imperative, Functional

Execution

Interpreted

Typing

Dynamic

Null Safety

NO

Memory Management

Garbage Collection

JavaScript is a high-level, dynamic programming language that conforms to the ECMAScript specification. Originally developed by Netscape to add interactive elements to websites, JavaScript has become a core technology of the World Wide Web, alongside HTML and CSS, and is supported by all major browsers without the need for plugins. Node.js, a JavaScript runtime, allows for JavaScript to be used on the server-side, enabling the development of fast, scalable network applications. This versatility makes JavaScript unique in its ability to handle both client-side and server-side programming.

Benchmarks

This benchmark tests how fast a programming language can perform mathematical computations without any I/O or memory allocation. We are using the Leibniz formula to approximate the value of PI.
Please note that the memory usage also includes the memory used by the HTTP server. Ideally, the most lightweight HTTP server should be used to measure the raw memory usage of the runtime.
Language
Time
Memory
JavaScript (Node.js v20)
1.93 s
10.6 MB
JavaScript (Node.js v18)
1.95 s
15.1 MB
JavaScript (Node.js v16)
1.96 s
11.3 MB
JavaScript (Node.js v14)
1.98 s
8.8 MB
JavaScript (Node.js v12)
2.05 s
7.7 MB
JavaScript (Bun v1)
1.94 s
12.8 MB

© 2024 Tien Do Nam