Fireship · @fireship
JavaScript just got way faster
Uploaded July 6, 2022 · Length 3:15
Summary
javascript runtime bun announced its first beta release, claiming to be significantly faster than node or dino, with orders of magnitude improvement in performance.
- javascript runtime
- bun
- node.js
- dino
- performance
- javascript engine
- web development
Transcript preview
The first 2 minutes of the transcript. Select a timestamp to watch that moment on YouTube.
- 0:01
it is july 6 2022 and you're watching
- 0:04
the code report one of the most profound
- 0:06
quotes about the javascript ecosystem
- 0:07
comes from an old british guy who said
- 0:09
out of intense complexities intense
- 0:12
simplicities emerge at the time nobody
- 0:14
knew what the hell he was talking about
- 0:16
but in 2022 it's clear he was
- 0:17
prophesizing the rise of a new
- 0:19
javascript runtime called bun that's
- 0:21
right you no longer need node.js or dino
- 0:23
so go ahead and uninstall those from
- 0:25
your system right now bun just announced
- 0:26
its first beta release and makes the
- 0:28
claim that it's significantly faster
- 0:30
than node or dino not just a little bit
- 0:31
faster but orders of magnitude faster
- 0:34
it's always a good idea to be skeptical
- 0:35
about benchmarks provided by the creator
- 0:37
of a tool but as you can see here it's
- 0:39
about three times faster when server
- 0:40
rendering react running database queries
- 0:42
or executing native code with foreign
- 0:44
functions impressive
- 0:46
very nice
- 0:48
but what i'm more excited about is what
- 0:49
this tool can do to simplify your life
- 0:51
as a developer we'll get into that in
- 0:53
just a minute but first i know my mom is
- 0:55
going to ask me what a javascript
- 0:56
runtime is in the first place you can
- 0:58
think of javascript like gasoline it's
- 0:59
dangerous and bad for the environment
- 1:01
and by itself isn't very useful to make
- 1:03
javascript or gasoline useful it needs
- 1:05
to run through an engine to convert it
- 1:07
into raw energy or machine code for a
- 1:09
cpu the most popular javascript engine
- 1:11
is google's v8 which powers chrome node
- 1:14
and dino and makes javascript execution
- 1:16
extremely fast with just in time
- 1:18
compilation now gasoline combined with
- 1:20
an engine still isn't very useful the
- 1:21
average person wants that engine in a
- 1:23
car with user-friendly apis like wheels
- 1:25
file system access subwoofers websockets
- 1:28
automatic transmission and so on a
- 1:30
javascript runtime is a complete car all
- 1:32
you have to do is put a little bit of
- 1:34
javascript in the tank and it will take
- 1:35
you anywhere you want to go now that
- 1:37
we're done with that ridiculous analogy
- 1:38
let's talk about what makes bun special
- 1:40
a big one is obviously performance but
- 1:42
how does it actually go so fast well
- 1:44
first of all it doesn't use the v8
- 1:46
engine but instead uses javascript core
- 1:48
from webkit which is generally
- 1:49
considered to be faster but more
- 1:51
difficult to work with in addition it's
- 1:53
written in a low level programming
- 1:54
language called zig this is a relatively
- 1:56
new language that's similar to c or rust
- 1:59
and the creators of bun say the lack of


