Giter Club home page Giter Club logo

nodejs-vs-deno-vs-bun-vs-others's Introduction

NodeJS vs Deno vs Bun vs Others

DISCLAIMER: this document is a work in progress (tests are finished, but results are to be published together with the instructions to carry on them)

Introduction

With the arrival of a new competitor to the Javascript runtime ecosystem, Bun, I was curious about how fast it is, because one of its selling points is that it is faster than NodeJS and Deno.

So, the idea of this repository, is to test the following Javascript runtime environments:

Runtime Appareance Coded in Estimated usage (*)
NodeJS 2009 C++ 71%
Deno 2018 Rust (originally in Go) 8.5%
Bun 2021 Zig 3.2%

In order to make the tests more interesting I added 2 fast native environments, C++ and Rust, a classic one like Java (no GraalVM at the moment), and also a "slow" one like Python. Future versions of these tests will include Go and a GraalVM version of the Java test.

Tests are executed from JMeter via some REST APIs.

Language/Runtime Version REST Library/Framework used Version
Bun 0.5.9 Express 4.18.2
C++ g++ 12.2.1, C++20 mode Drogon 1.8.4
C# 11 .NET 7.0
Deno 1.33.3 Express 4.18.2
Java (OpenJDK) 19.0.1 Spring boot 3.0.6
NodeJS 20.1.0 Express 4.18.2
Python 3.11.3 Flask 2.3.2
Rust 1.69.0 Rocket 0.5.0-rc.3

For more information about the latest versions check the version.txt file.

Tests

The tests are based on the following REST APIs:

Verb Route Result Description
GET / Fixed little string: e.g. "Deno test" Very simple API that return a fixed data
GET /echo/<data> Return the same <data> Simple API that return the same received data
GET /getPrimesLessThan/<limit> Return a list of primes less than <limit> CPU and memory are function of the specified limit
GET /countPrimesLessThan/<limit> Return the number of primes less than <limit> CPU is function of the specified limit

Notes

  • All tests are coded without tweeking them for performance (CPU, network usage, etc) or memory consumption. The idea is to add tweaks for all examples in the future.
  • Currently the only minor tweak is in the Rust application in order to be on pair with C++ (primes functions were hinted as inline).
  • For sure there are better ways to test these runtimes/languages, but as an entry point, they could be useful to have an idea of where is each implementation.

nodejs-vs-deno-vs-bun-vs-others's People

Contributors

jalbiero avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.