WinterJS - A New Javascript Runtime

ThePrimeTime
15 Mar 202427:06

Summary

TLDRThe video script discusses the rapid emergence of new JavaScript frameworks and runtimes, focusing on Winter JS 1.0, a fast, fully compatible JavaScript runtime written in Rust. It questions the claims of speed and compatibility, highlighting the importance of real-world workloads over synthetic benchmarks. The speaker emphasizes the limitations of JavaScript for general-purpose programming and suggests that the choice of language or runtime often doesn't matter as much as the actual implementation and workload.

Takeaways

  • 🚀 Introduction of Winter JS 1.0, a new JavaScript runtime claiming to be the fastest.
  • 💡 Winter JS is written in Rust and uses the Spider Monkey engine to execute JavaScript and Tokyo for HTTP requests.
  • 🌐 It can be compiled to WebAssembly, making it runnable in web browsers like Edge.
  • 🔥 Winter JS 1.0 claims to handle 150,000 requests per second when executed natively.
  • 🔄 The script questions the 'fastest' claim, comparing it to other technologies like Bun and Node.js.
  • 📊 Discussion on benchmarking and how it may not always reflect real-world performance.
  • 🛠️ The importance of real-world workloads and applications over synthetic benchmarks.
  • 🔧 Mention of compatibility issues with Winter JS, noting that it's not fully compatible with all JavaScript features.
  • 🔄 The script suggests that the real value lies in ecosystems and tooling, rather than raw speed.
  • 🤔 A call for more meaningful tests, such as building and running a real application to truly measure performance.
  • 🎯 The emphasis on understanding the practical implications of using different technologies in development.

Q & A

  • What is the main topic of discussion in the transcript?

    -The main topic of discussion is the introduction of a new JavaScript runtime called Winter JS 1.0, and its comparison with other JavaScript frameworks and runtimes in terms of speed and compatibility.

  • What is the difference between a JavaScript runtime and a framework according to the transcript?

    -A JavaScript runtime is an environment that executes JavaScript code, handling memory management and other system tasks, whereas a framework is a set of pre-written code that provides a structure for developers to build upon.

  • What does the speaker find questionable about Winter JS 1.0's claim of being the fastest?

    -The speaker questions Winter JS 1.0's claim of being faster than other runtimes like Bun, which is written in Zig, because at the end of the day, Winter JS is still running JavaScript code.

  • What are the key features of Winter JS 1.0 mentioned in the transcript?

    -Winter JS 1.0 is described as a fast, fully compatible JavaScript runtime written in Rust, using the Spider Monkey engine to execute JavaScript and Tokyo to handle underlying HTTP requests and JS event loops. It can also be compiled to WebAssembly.

  • What is the speaker's main concern about the compatibility of Winter JS 1.0?

    -The speaker is concerned that Winter JS 1.0 claims to be fully compatible with JavaScript, but it does not implement certain features like back pressure and transform streams, which are not yet supported.

  • How does the speaker feel about the benchmarks provided for Winter JS 1.0?

    -The speaker is skeptical about the benchmarks, as they believe they are synthetic and do not represent real-world workloads. They argue that the actual performance of a runtime matters more than just raw speed in benchmark tests.

  • What is the speaker's suggestion for a more meaningful test of Winter JS 1.0?

    -The speaker suggests building a real application, such as a to-do application driven purely by server components, and then comparing the performance of that application running on Winter JS 1.0 with similar applications on other runtimes.

  • What does the speaker think about the importance of using a fast runtime or framework?

    -The speaker believes that while efficiency is important, it is not the most crucial factor. They argue that in many cases, the choice of runtime or framework does not significantly impact the actual performance when dealing with real-world applications and workloads.

  • How does the speaker describe the performance of Go and Rust in handling a real-world workload?

    -The speaker describes Go and Rust as being able to handle a significant number of games running simultaneously without dropping frames, with Rust being able to maintain 60 frames per second for 2,000 games and Go having a 1% frame drop rate.

  • What is the speaker's overall opinion on the significance of the new JavaScript runtime, Winter JS 1.0?

    -The speaker is skeptical about the significance of Winter JS 1.0, questioning its claims of speed and compatibility, and suggesting that such advancements may not be as impactful as they seem in practical, real-world scenarios.

Outlines

00:00

🚀 Introduction to Winter JS 1.0

The paragraph introduces Winter JS 1.0, a new JavaScript runtime that claims to be the fastest. It discusses the difference between a runtime and an engine, and highlights the announcement of Winter JS as a fast alternative to existing JavaScript frameworks and runtimes like Node.js. The speaker expresses skepticism about the 'fastest' claim, especially when comparing it to other technologies like Bun, which is written in Zig.

05:03

🤔 Technical Details and Compatibility Concerns

This paragraph delves into the technical aspects of Winter JS, questioning its compatibility and the practicality of its claims. It mentions that Winter JS is written in Rust and uses the Spider Monkey engine to execute JavaScript, with Tokyo handling HTTP requests. The speaker points out that while Winter JS claims to be fully compatible, there are certain features like back pressure and transform streams that are not yet implemented.

10:03

🏃‍♂️ Performance Benchmarks and Comparisons

The speaker discusses the performance benchmarks of Winter JS, comparing it to other technologies like Bun and Node.js. It mentions that Winter JS can handle a high number of requests per second, both when executed natively and when compiled to WebAssembly. However, the speaker also raises concerns about the validity of these benchmarks, questioning the type of requests being measured and the conditions under which these tests were conducted.

15:04

🔧 Implementation and Practicality

This paragraph questions the practicality of implementing Winter JS, especially in comparison to using a fast language like Go for general-purpose programming. The speaker argues that JavaScript may not be the best choice for performance-critical applications and shares personal experiences with game programming to illustrate the point that performance can degrade significantly with more complex workloads.

20:04

🧐 Real-World Testing and Ecosystem

The speaker calls for real-world testing of Winter JS by building a server-driven application and measuring its performance. They emphasize the importance of considering the entire ecosystem and tooling around a technology, rather than just its raw performance. The paragraph also discusses the challenges of convincing developers to switch from JavaScript to a new runtime like Bun or Winter JS.

25:05

📉 Synthetic Benchmarks and Real Workloads

The paragraph criticizes the focus on synthetic benchmarks and emphasizes the importance of testing with real workloads. The speaker shares a personal story of testing different technologies with a complex application and stresses that the performance difference between technologies becomes negligible when dealing with actual workloads. They argue that the hype around fast runtimes is overblown and that it's more important to focus on building a usable and efficient system.

Mindmap

Keywords

💡JavaScript runtime

A JavaScript runtime is an environment that executes JavaScript code. It manages memory and handles operations such as executing scripts and interacting with the file system. In the context of the video, the speaker discusses a new JavaScript runtime called Winter JS, which claims to be faster than its competitors.

💡Spider Monkey engine

Spider Monkey is an open-source JavaScript engine developed by Mozilla. It is used to parse and execute JavaScript code. In the video, Winter JS 1.0 is noted to use the Spider Monkey engine for executing JavaScript, highlighting its role in the performance of the new runtime.

💡Rust

Rust is a systems programming language that aims for safety and performance. It is known for its memory safety features and concurrency support. In the video, Rust is mentioned as the language in which Winter JS is written, emphasizing its potential for high performance and reliability.

💡WebAssembly

WebAssembly is a binary instruction format for a stack-based virtual machine. It is designed as a portable target for the compilation of high-level languages like Rust, C, and C++ to web pages, enabling deployment on the web for client and server applications. In the video, it is mentioned that Winter JS can be compiled to WebAssembly, allowing it to run in web browsers.

💡Cloudflare workers

Cloudflare Workers is a global network of edge computing servers that allows developers to run JavaScript code in response to HTTP requests. This service can be used to speed up and secure websites. The video discusses Winter JS's compatibility with Cloudflare Workers, indicating its potential use in cloud-based applications.

💡React Server Components

React Server Components is a feature in React that allows components to be rendered on the server. This can improve the performance and load times of web applications by sending only the necessary HTML to the client. The video talks about Winter JS's support for React Server Components, indicating its utility in modern web development practices.

💡Performance benchmarking

Performance benchmarking is the process of evaluating the performance of a system or component by running standard tests and comparing the results. In the video, the speaker discusses various benchmarks and comparisons between Winter JS, Bun, and other JavaScript runtimes, questioning the validity and relevance of these tests.

💡Async hooks

Async hooks are a feature in Node.js that allow for the tracking and management of asynchronous operations. They can be used to diagnose performance issues related to asynchronous code. In the context of the video, the speaker mentions that not implementing async hooks in Winter JS contributes to its claimed performance advantage over Node.js.

💡Compatibility

Compatibility refers to the ability of a system or component to work with other systems or components without issues. In the video, the speaker critiques Winter JS's claim of being fully compatible with Web standards, pointing out that certain features like back pressure and transform streams are not implemented.

💡Synthetic benchmarks

Synthetic benchmarks are tests designed to measure the performance of a system under controlled and often idealized conditions. They may not accurately represent real-world usage scenarios. The video criticizes synthetic benchmarks for JavaScript runtimes, arguing that they do not reflect the performance of actual applications.

💡Startups

Startups are new businesses that are in the early stages of development. The video mentions startups in the context of discussing the practicality of using different JavaScript runtimes, suggesting that many startups fail and therefore the choice of technology may not be as critical as some believe.

Highlights

The introduction of Winter JS 1.0, a new JavaScript runtime.

Winter JS is宣称为最快的JavaScript运行时,但作者对此表示怀疑。

Winter JS 1.0是用Rust编写的,使用Spider Monkey引擎执行JavaScript。

Winter JS声称在四个月内取得了显著的速度提升。

Winter JS的全面兼容性受到质疑,因为它尚未实现某些功能。

Winter JS的云原生API兼容性和对React服务器组件的支持。

Winter JS 1.0能够处理每秒150,000个请求,当本地执行时。

Winter JS在编译到WebAssembly时,性能下降,每秒只能处理20,000个请求。

作者对Winter JS的性能基准测试表示怀疑,并认为这些测试没有意义。

作者通过比较不同语言的性能,强调了JavaScript在处理复杂逻辑时的性能局限。

作者提出了一个观点,即在JavaScript中,即使是简单的任务也可能导致性能大幅下降。

作者对JavaScript作为通用编程语言的选择表示质疑。

作者认为,尽管某些语言可能在性能上更快,但它们并不一定能提供更实际的价值。

作者强调了在实际应用中,性能基准测试的结果可能并不可靠。

作者建议,应该通过构建真实的应用程序来测试性能,而不是依赖于合成的基准测试。

作者对JavaScript运行时的快速迭代和新框架的频繁出现表示困惑。

作者通过个人经验,比较了不同语言在处理高负载应用程序时的性能。

作者对编程语言的选择提出了建议,强调了工具和生态系统的重要性。

作者对当前JavaScript框架和运行时的性能竞争表示失望,并认为这并不是正确的发展方向。

作者分享了自己的游戏编程经验,以此来说明在实际应用中性能的重要性。

作者对编程社区中对某些语言的过度炒作表示批评,并提倡更加实际和有意义的性能测试。

Transcripts

play00:00

I don't know how this keeps happening

play00:01

but how do we go one month just just one

play00:04

month and we have a new JavaScript

play00:06

framework already okay or not JavaScript

play00:08

framework but JavaScript runtime okay

play00:10

not even a framework for those that

play00:11

don't if you don't know the difference

play00:13

between a runtime or what a runtime is

play00:15

let me just say this so remember

play00:17

JavaScript executes in like a little

play00:19

engine okay this thing takes care of

play00:21

memory management it takes care of like

play00:24

keeping track of acing tasks and all

play00:26

that kind of stuff okay uh whereas you

play00:28

need the ability to actually interact

play00:29

with like the file system right you need

play00:32

to be able to actually make requests out

play00:34

somewhere you need to be able to do like

play00:35

a bunch of extra stuff so this would be

play00:39

like

play00:40

V8 this is node okay so someone has

play00:46

Rewritten node and potentially swapped

play00:48

out the engine let's find out the thing

play00:50

that they've done winter JS 1.0

play00:53

announcing winter JS the fastest

play00:54

javasript damn they actually went for

play00:57

the fastest now that's kind of a bold

play00:59

move because at the end of the day

play01:00

you're still running

play01:01

JavaScript right and you're claiming to

play01:04

be faster than bun which is written in

play01:07

Zig so I don't even know what is this is

play01:09

this is this written in Rust is this

play01:11

rust versus Zig the fastest JavaScript

play01:13

web uh server now also supporting

play01:15

cloudflare applications and react server

play01:17

components

play01:19

speed winter JS 1.0 is finally here

play01:22

winter JS is an incredibly fast winter

play01:24

CG compatible JavaScript runtime written

play01:27

in Rust using spider monkey engine to

play01:29

execute JavaScript and Tokyo to handle

play01:31

underlying HTTP requests and JS Event

play01:34

Loop winter JS runtime can also be

play01:36

compiled to web assembly and as such is

play01:39

the first production grade runtime fully

play01:42

runnable in wer

play01:44

Edge okay okay here's what we have

play01:47

accomplished for winter uh JS 1.0 in

play01:50

just four months after our first

play01:51

announcement blazing fast speeds faster

play01:53

than bun worker D and node well I mean

play01:56

being fast than node we've all learned

play01:58

is not that bad and all you to do is

play02:00

just not Implement any of the async

play02:02

hooks that bun does or that node does

play02:04

and boom you're faster winter JS is now

play02:06

fully compatible you can't put an aster

play02:10

you can't you can't say this and then

play02:12

throw an aster I just want to let you

play02:14

know you cannot do that that's not

play02:16

allowed okay that's not allowed right

play02:19

there no I don't care what is what's the

play02:22

aster what's the aster

play02:26

mean well where the hell do they Define

play02:28

the asteris

play02:37

what it can't be that one

play02:42

okay it is it this one back pressure and

play02:45

transform streams and some non-common

play02:47

crypto algorithms are not implemented

play02:48

yet oh it is this okay yeah that sounds

play02:50

like you're not fully compatible just

play02:52

throwing that out there fully means full

play02:55

shaft here okay I mean I get it you I

play02:59

get it is you're not like Loosely

play03:02

compatible 97% compatible yeah 35ths

play03:05

compatible uh just wrap it with quotes

play03:08

compatible uh let's see

play03:10

okay oh well oh I'm stupid I'm stupid

play03:14

I'm stupid it says with the winter GC

play03:16

spec okay I said there we go I thought

play03:18

it was just I my bad but still you still

play03:22

can't say fully compatible you still

play03:24

can't say this you still can't do that

play03:25

cloud flare API compatibility web

play03:27

framework support nextjs supporting

play03:28

react server components hono Astro seel

play03:30

kit uh now let's see more detail each of

play03:33

these features ridiculously fast winter

play03:35

JS 1.0 is able to handle 150,000 request

play03:37

per second when executed natively

play03:40

natively just means running JavaScript

play03:42

right is that what this means in this in

play03:43

this L plus ratio plus stupid

play03:46

potentially that that literally just

play03:47

means running JavaScript right no no

play03:51

compiled to WX no I don't think so

play03:52

because it says 20K request per second

play03:54

when compiled uh to wasm using wasix

play03:56

wasix is just like a wasm spec right

play03:58

it's like extended wasm spec right uh as

play04:01

of today winter JS can handle more

play04:02

requests per second than bun 117,000

play04:05

requests per second worker D 40,000

play04:07

requests per second and noj has 75,000

play04:09

requests per second

play04:10

okay what kind of requests are we

play04:12

talking about here I do like that you

play04:15

put the lightning bolt on here okay

play04:18

lightning bolts you know this kind of

play04:19

lightning bolt holds a very special

play04:20

place in my heart because when I was a

play04:22

kid there was no greater feeling in the

play04:26

universe than getting the lightning bolt

play04:28

while playing Mario for the Super

play04:30

Nintendo Mario Super Mario Kart for the

play04:32

Super Nintendo okay there's no greater

play04:35

feeling so when I see that lightning

play04:36

bolt it makes me feel warm

play04:38

inside

play04:39

okay all right I do want to see The

play04:42

Benchmark all right what's the Benchmark

play04:44

here where do you simple is kind of

play04:46

confusing to me because where do you

play04:48

where do you specify stuff is it

play04:50

something like this what is this worker

play04:52

C oh this must be some sort of cloud

play04:54

flare bsas flake oh man they're nixing

play04:57

oh my goodness Nix boners are in the

play04:58

chat as we speak Speak oh no Nick boners

play05:02

here it comes um all right so no

play05:08

simple

play05:10

ah but hold on May I say may I say hold

play05:13

on May I say hold on look at what's

play05:16

Happening Here everybody look at this

play05:18

new response hello I guess we're going

play05:20

to have to what what is a response I'd

play05:23

have to look at the source code for

play05:24

response to understand this okay but

play05:27

look at this one you have to create an

play05:28

object right here

play05:30

something tells me these these don't

play05:31

feel like necessarily the same that's a

play05:34

web standard I hear that but is that is

play05:38

that header being set by doing an object

play05:41

merge here or is that header being set

play05:43

in the zig level hey I'm just saying

play05:45

there's a difference okay writing a

play05:48

header at the point of

play05:50

request at like the the deep down Zig

play05:53

level versus writing writing that header

play05:56

in as an object free floating in node

play05:59

remember I mean there there's just a

play06:01

simple there is a difference okay uh

play06:03

this is stupid if you're running native

play06:05

just use a fast language for

play06:07

sake that's a lot of going

play06:09

on here buddy I can't take it anymore JS

play06:11

is objectively poor choice for a general

play06:13

purpose programming language I do agree

play06:15

it is a very great language for UI just

play06:17

like Lua I think Lua is a great D I mean

play06:19

I think dynamic programming languages

play06:20

are great glue languages that's the

play06:21

point of dynamic programming languages

play06:24

um why is there code uh uh true I agree

play06:28

base take out fast server that's

play06:31

the that's the F like that's the thing

play06:33

hey thank you P PP PPH PP

play06:37

hav what a name what a name can we

play06:40

just get some claps in the chat for PP

play06:42

hav coming in tier three oh my goodness

play06:44

just give me the exe baby um anyway so

play06:47

that's one thing I just see right away

play06:49

that makes me a little bit like Curious

play06:51

and this also right here what's going on

play06:53

right here how's this how is this

play06:54

implemented right like I don't feel like

play06:57

in my opinion I again I we talked about

play07:00

this earlier right where there's these

play07:02

things that end up happening I think I

play07:03

actually already have the diagram uh

play07:07

yeah I already have the diagram right

play07:10

here which is these these dumb examples

play07:12

that are just these like super super

play07:15

super tiny examples and they're just

play07:17

saying like look how fast we are the

play07:19

reality is is like if you do anything

play07:22

like anything in JavaScript you're going

play07:25

to massively slow it down you run react

play07:28

one time to render a div which remember

play07:31

they're saying they support server side

play07:34

uh server server components right you

play07:35

write a by the way this is in invalid

play07:38

syntax uh sorry here let me properly

play07:41

close that div for us all right there we

play07:43

go you write a singular div right just

play07:47

one guess what like your 100K requests

play07:51

or whatever these things that they're

play07:52

trying to tell you is is going to happen

play07:54

it's going down lit by potentially 100x

play07:57

you might only be able to do this a,

play07:59

times maybe 2,000 times maybe 10,000

play08:03

times who knows but whatever is

play08:05

happening this is getting dominated one

play08:08

of the greatest exercis I ever did in my

play08:10

lifetime was when I first started off

play08:11

trying to learn how to do game

play08:12

programming in XNA you may have heard of

play08:14

it game studios Microsoft C baby I was a

play08:16

c Andy at one point I did years of Z I

play08:19

absolutely loved it but one of the first

play08:21

things that I was taught is you always

play08:22

make a FPS counter right away and you

play08:25

paint it in your upper left hand corner

play08:27

of the screen right that's like the

play08:28

first thing you build so when I first

play08:29

started off I saw man I had 3 thou I was

play08:31

going at like 3,000 frames a second oh I

play08:34

have I have frames for days and then I

play08:37

wrote a triangle and it's like 3,000 to

play08:40

like 500 or something like that you know

play08:42

just like a just a just a massive you

play08:45

know jump down in the amount of frames

play08:47

that I was having available and that's

play08:48

when I realized oh crap like you

play08:52

actually have to be really thoughtful

play08:54

about what you're doing you can't just

play08:56

simply assume that just because it

play08:58

starts off as a huge number that that

play09:00

number nicely goes down slowly over time

play09:04

even though you're adding tons of

play09:05

features no it's like a logarithmic

play09:07

curve it goes it it dies fast and then

play09:12

slowly goes down just add one Json

play09:14

string of five Json pars and the request

play09:16

Handler and it's all over exactly the

play09:18

curse of FPS I know and so it's one of

play09:20

those things that you get sold these

play09:22

kind of crappy examples of why this is

play09:25

super awesome the thing like I don't

play09:28

know what spider monkey has done does

play09:30

spider monkey have as good of Json uh

play09:33

stringification and parsing that V8 does

play09:35

like V8 has some of the best Json

play09:38

parsing there is it's Sim deed out of

play09:41

its mind it's super fantastic it's

play09:43

faster at parsing jesson than it is at

play09:45

parsing JavaScript it is fast it is

play09:49

smooth and it can go really really quick

play09:52

uh you know for JavaScript and and and

play09:54

and and Json and all those things right

play09:57

simd nuts exactly and so it's like one

play09:58

of those things where

play10:00

these kind of tests don't mean anything

play10:03

what about noes URL parsing I hear it's

play10:05

I hear it's the tippity top I hear it's

play10:06

the tippity

play10:08

top um yeah spider monkeys the Firefox

play10:10

runtime yeah I I know um but this is

play10:13

just like why this whole thing is just

play10:15

so uninteresting in the sense that when

play10:17

they say this it means nothing they need

play10:19

to show you a real thing right so what I

play10:22

want to see is

play10:25

build an application a to-do application

play10:27

that's purely server driven

play10:30

and then take that purely server driven

play10:34

application use your little react server

play10:36

components or whatever you want to use

play10:38

and see how fast you can run

play10:41

that that makes way more sense right I

play10:44

don't want to clone it investigate

play10:45

because I don't want to spend three

play10:46

hours investigating into something that

play10:48

I just don't really care okay I can just

play10:51

tell you right now this it's just like

play10:53

it's just it it's just plainly wrong and

play10:55

I bet you there's already somebody out

play10:56

there that has now coming and saying hey

play10:58

it's impossible watch this here comes I

play11:00

benchmarked using my main branch on

play11:02

Apple silicon mini M2 bun on a single

play11:04

core serves

play11:06

192,000 uh requests per second winter JS

play11:09

utilizing three cor serves 880,000

play11:10

requests per second so approximately 6X

play11:12

slower than bun I don't know where this

play11:14

claim is coming

play11:15

from and this guy's name is just JS a

play11:18

very small V8 JavaScript runtime oh it's

play11:21

another runtime damn I just got owned by

play11:23

another runtime but hey I'll follow you

play11:25

what a great thing but I mean I think

play11:26

this is correct but also this is very

play11:28

interesting utilizing multiple cores

play11:36

H uh but this is a good point again this

play11:38

is why you don't trust any just don't

play11:41

trust benchmarks okay because who am I

play11:43

supposed to trust now should I trust

play11:44

winter JS or should I trust just JS

play11:48

which one should we

play11:50

trust like how do you even know uh this

play11:53

was used let's see uh this was using 64

play11:55

connections two threads uh for work if

play11:57

you look at the bench they describe uh

play11:59

how they are obviously running on a

play12:01

machine with at least 12 cores and

play12:03

comparing bun and others to running on a

play12:04

single thread oh no did we miss that oh

play12:07

no oh no oh no this Benchmark is a

play12:11

MacBook Pro M3 Max laptop with 64 GB of

play12:14

RAM okay so that must that must that's

play12:17

them saying this how do you know that

play12:18

it's working with that my my question is

play12:20

up let's see worker D Darwin arm 64

play12:23

serve do this thing uh like how do you

play12:25

know how many how many cores are being

play12:28

used cuz this thing say 12 threads this

play12:30

one 12 threads this one bun 12 threads

play12:32

this one oh this is how many threads are

play12:34

obviously being oh this is the what's it

play12:36

called This is the uh this is the work

play12:38

this is how many threads they're using

play12:39

for connections so that's the I mean

play12:41

that's the thing I don't get is how do

play12:42

you know how how do you know that this

play12:44

is using more more resources with winter

play12:47

JS than the other one T12 yeah the t2

play12:49

that's just that's just the worker

play12:50

threads right that's these guys right

play12:52

here that's this thing that's that's

play12:54

like uh you know like any of the any of

play12:56

the HTTP testing Frameworks you just

play12:59

know this so from this you don't know

play13:01

right cuz they're all they're all saying

play13:02

12 threads because they're all testing

play13:03

with the same amount of threads you have

play13:05

to look at htop you have to look at

play13:06

something else that actually is doing it

play13:08

all right OS threads uh potentially not

play13:10

equaling Hardware threads winter JS is a

play13:12

side project why Bob left the IT

play13:14

department six scores uh is pitifully

play13:16

slow anyways 19 uh 17.1 n megabytes per

play13:20

second is pitifully slow got him um I

play13:23

haven't figured out how to compile it on

play13:24

Linux there's a C++ compiler error when

play13:26

it compiles a MJS CIS after hanging for

play13:29

about 10 minutes tried using Nick shell

play13:32

uh and ALS let's see and also without

play13:34

that yeah I don't even have yeah

play13:36

happened to be on Ubuntu 2204 see I only

play13:38

have Ubuntu uh anyways are you comparing

play13:41

uh Native bun what what is this

play13:44

native what is this native business they

play13:47

keep saying uh it also seems to have

play13:49

some kind of massive memory leakage

play13:50

around 30 gigabytes RSS after a few work

play13:55

runs let's go let's go uh again this is

play13:59

why be careful what you say I mean the

play14:02

wasar people are pretty smart people I'm

play14:04

not saying I I'm not like knocking them

play14:07

but this is why you should be very very

play14:09

careful saying these

play14:12

things okay I like the tweets so people

play14:15

can see it right when I like the tweet

play14:16

it shows up everywhere um it's very

play14:21

interesting another JavaScript runtime

play14:23

another disappointment in the end I mean

play14:26

I mean like bun is bun is pretty cool

play14:28

but again bun still has this problem

play14:29

where it's just like how are you going

play14:31

to convince everybody to switch over

play14:32

from no. JS to bun JS like I just

play14:34

foresee that being very very difficult

play14:37

um not only that but like what are you

play14:39

really buying yourself if you have any

play14:40

sophisticated logic at all in JavaScript

play14:42

you actually haven't bought anything I

play14:44

couldn't really tell a difference and I

play14:45

played with it for hours upon hours upon

play14:47

tens of hours trying to get a difference

play14:49

between V8 and Bun and I could not

play14:51

really find a strong difference in the

play14:54

the actual JavaScript execution now

play14:57

there is a big difference when it comes

play14:58

to you know the runtime and how they

play15:00

handle async stuff and Bun is just

play15:02

faster but bun has less things that you

play15:04

can hook into like data dog if I'm not

play15:05

mistaken does not work on bun because

play15:07

they don't have all the hooks now I

play15:08

could be wrong at this point in life I

play15:10

don't know if they've changed things but

play15:11

when I last looked at it you couldn't do

play15:13

all that but now you get into this whole

play15:15

idea that like we're competing on the

play15:18

dumbest possible access right like

play15:22

writing a fast JavaScript runtime and

play15:25

trying to like compete with bun or no.

play15:27

JS I think you're just fundamentally

play15:29

doing the wrong thing cuz all you're

play15:30

really testing is how fast is my native

play15:33

code compared to your native code and

play15:35

it's just not real right it's just like

play15:37

not a it's just not a real test yes the

play15:40

only nice thing about bun is the tooling

play15:41

they built for like that's that's the

play15:42

reason that's honestly the reason to use

play15:44

bun is that they have an entire

play15:46

ecosystem and tooling around it right

play15:48

like that's much

play15:50

better the thing is is that you could

play15:52

write the world's most simple go server

play15:56

and you're going to be able to do you're

play15:57

going to be able to do a massive

play16:00

amount right you're just going to be

play16:02

able to do a really good job here you

play16:04

know what you know what forget about it

play16:06

I have let's see let's go like this

play16:08

let's go to personal hey flip you're

play16:10

going to have to edit this to make it

play16:12

like quick you know what I mean don't

play16:13

have all of this on here because this is

play16:16

way too much make uh go test go test uh

play16:21

go mod anit suck it.t v/ just it all

play16:26

right there we go we have this one uh uh

play16:29

command all right and main.go okay P

play16:33

perfect package main bum uh main here we

play16:37

go and just to make sure I have the

play16:39

exact same thing I don't even know if I

play16:41

have work uh installed on my computer

play16:43

all right so here's the command that

play16:44

they're running fantastic I love it uh

play16:49

and then let's see uh I don't even know

play16:51

how to do the HTTP uh server right what

play16:54

is it it's uh no no no no it's HTTP

play16:57

handle Funk this guy

play16:59

and then what did they have I think it

play17:00

was just hello right what was it it was

play17:03

just hello right we have a writer so we

play17:05

have a what is it format F print can I

play17:07

just do

play17:13

that can I just print is that like is

play17:16

that something we can do is that all I

play17:17

need to do I you know that's the that's

play17:19

the thing I don't even know if I have to

play17:21

do that I never raw dog a little uh

play17:24

format server uh oh and then I have to

play17:26

go like this HTTP what do we have to

play17:28

listen and serve on 80 okay

play17:31

fantastic go run command mang go and

play17:36

this may be in debug but who cares for a

play17:38

second HTP uh whoopsies get out of here

play17:41

curl HTTP uh 12700

play17:46

01 8080 okay so we got the same hello I

play17:49

got a capital letter they don't got a

play17:51

capital letter can I do

play17:53

verbose uh real question does it

play17:56

set how do I view the headers

play17:59

response headers content length five

play18:01

text there you go see there we go so we

play18:03

have we're getting everything in here

play18:05

okay so we got we got it all we got it

play18:07

all good IP leaked 20 uh 127 okay so do

play18:11

I have

play18:13

work no I don't have work okay uh hold

play18:17

on I'm going to pseudo app and we'll do

play18:18

this for a quick second hold on there we

play18:21

go first off I think I'm in debug build

play18:23

right now right this is just like

play18:26

nothing fantastic going on here

play18:30

okay so we destroy just

play18:32

destroyed absolutely just

play18:36

wrecked hands down destroyed demolished

play18:40

debug builded uh we go what how do you

play18:44

do a good what's like what's a good

play18:46

debug how do I do a debug build and go

play18:48

or a release build release build go I I

play18:52

don't even know I always have to look

play18:54

this up cuz I write this like once per

play18:55

Docker file and I never look at it again

play18:58

uh default go build combin symbols and

play19:00

debug information however you can remove

play19:01

all this stuff and do go this one right

play19:03

here okay is that the one we want to do

play19:05

uh common go just just go build but it

play19:07

has all that extra crap in there I want

play19:09

like the the most the most smoothest

play19:12

most smallest

play19:16

possible one okay I got the same thing

play19:19

destroyed absolutely wrecked I'm on a

play19:22

sign I'm on a very my CPU is

play19:24

significantly weaker than anything

play19:26

they're running right uh first off

play19:30

if you uh cat uh Pro CPU info right like

play19:36

I'm on a I'm on not nearly the same I am

play19:40

not nearly the same I only have I'm on

play19:43

like a little liir Pro okay I'm I I am

play19:47

not on a very fast CPU

play19:50

right okay I mean good CPU nice but

play19:53

still a a it's a couple years old this

play19:57

there's nothing fantastic FC going on

play19:59

here right this guy seems mobile Weare

play20:02

yeah exactly I'm not using a fantastic

play20:04

computer this guy's on an M3 Max laptop

play20:06

with 64 gigs of of of

play20:10

ram okay right so it's like I'm not

play20:14

using a lot and I just destroyed it okay

play20:19

wrecked wrecked it apparently we can't

play20:21

get was Winter JS to easily build is

play20:23

that what we saw let's see if they may

play20:25

have fixed it already let's let's find

play20:27

out can I can I just do this H I don't

play20:30

want I don't want to I honestly I don't

play20:31

want to deal with building it and all

play20:33

that okay I'm not even going to do it

play20:34

I'm not cuz I got to go like we got to

play20:36

go like read stuff and build it and it's

play20:37

going to take forever to do stuff I

play20:39

don't want to do this we're not going to

play20:40

do it we'll do it later but just use the

play20:43

nyck flake I have to get NX install then

play20:45

understand how to Nix it yeah just give

play20:47

me the exe all right there you go that's

play20:50

how I feel about the whole situation do

play20:52

with bun fine here I I'll do with bun

play20:54

there you go I think I have bun right

play20:56

yeah yeah yeah I I have bun bun update

play20:57

is that how you do it uh bun

play21:01

uh is there a way to oh upgrade there

play21:03

you go I'll make sure yes there we

play21:09

go there we go we upgraded upgrade

play21:12

upgrade upgrade all right so we'll this

play21:14

will give us a some light into what's

play21:15

happening here okay some light not like

play21:18

a ton of light but you know some

play21:22

light and then we'll do a bun

play21:27

simple uh bun. TS is that what you call

play21:31

these things I assume so bun bun

play21:35

TS

play21:37

fair fair

play21:43

okay there we go actually let's run it

play21:47

over here bun bun TS all right there we

play21:50

go so we got that 8080 and then now

play21:52

let's let's do a little

play21:57

work

play22:10

wrecked destroyed

play22:15

annihilated wck them um so there you go

play22:20

absolutely Grand absolutely

play22:24

Grand not even

play22:26

close again but it's doesn't matter cuz

play22:29

again it it just it again it just does

play22:31

not matter everything we did here

play22:33

doesn't matter because none of it

play22:34

actually makes any sort of sense or is

play22:37

Meaningful okay none of it's actually

play22:42

meaningful okay so again don't buy test

play22:46

okay see a real appload see a real

play22:49

workload okay like a real workload you

play22:52

actually have to have something that it

play22:53

does okay so here's a good here's a good

play22:55

story is I I had this like little

play22:57

example app that I built of few times

play22:58

it's a shooter app where you have two

play23:00

like computers come up and they shoot

play23:02

and they use websocket connections to do

play23:03

all that and we ran a test between how

play23:05

long can I maintain 60 frames per second

play23:08

updating in node versus Go versus rust

play23:11

at rust I could have like 2,000 games

play23:13

running and I didn't drop a single frame

play23:15

everything was 60 milliseconds on the

play23:17

dot or uh 60 frames per second on the

play23:20

dot for 2,000 running games in go it was

play23:23

like I was dropping like 1% of frames

play23:25

that means when I say dropping that

play23:26

means going um up above 17 milliseconds

play23:29

per frame that was wild right and so

play23:33

it's just like okay only 1% of them with

play23:35

node I couldn't get to 2,000 games and

play23:38

when I did get to like, 1500 games or

play23:40

whatever it was I was at like 20% of the

play23:42

frames were more than 17 milliseconds

play23:45

and so it's one of those things where

play23:47

when somebody tells you like a it's like

play23:48

so blazingly fast it's so amazing it's

play23:51

so this and so that it doesn't matter

play23:53

guys it doesn't matter shut the hell up

play23:55

about rust shut the hell up about Russ

play23:58

cuz it doesn't matter okay it doesn't

play24:01

matter I was just showing you a basic

play24:03

point that if you can just launch up any

play24:05

other language it go super duper Ultra

play24:07

dang fast okay just shut up it doesn't

play24:10

matter we're going to launch up rust and

play24:12

Bam wow it's going to be like 220 holy

play24:15

cow it's so fast but nobody actually

play24:16

cares because it's not actually doing

play24:18

something amazing okay can we just stop

play24:22

with it like I was I was really hoping

play24:24

you would understand the point of this

play24:27

which is that these type of tests are

play24:29

synthetic and they mean nothing okay

play24:31

because when we add a bunch of workload

play24:33

you know what Go's going to do it's

play24:34

going to drop by like 50% but bun is

play24:37

going to drop by like

play24:38

90% And it's going to have much more

play24:40

variation in requests which is all very

play24:44

very very important to understand okay

play24:47

it's very important because that's where

play24:48

it matters it doesn't matter when it's

play24:51

just hello world it matters when you're

play24:53

actually doing something like actually

play24:56

doing something you assumed I understand

play24:58

anything think shame on you no no I will

play25:01

not coat in Rust I will not my hair is

play25:03

not blue yeah guys I dyed I I I dyed my

play25:05

hair blue a long time ago okay I no

play25:06

longer have blue hair we don't program

play25:08

rust around here anymore uh benchmarks

play25:10

are more or less uh assume optimized

play25:12

code uh in reality that's rare yes like

play25:16

you should make things efficient because

play25:18

at the end of the day like inefficient

play25:20

code will truly cost you a lot of money

play25:23

as you actually get real users most of

play25:25

you don't even have real users okay you

play25:27

guys just just have a bunch of startups

play25:29

that have zero users it has only your

play25:31

test user so it doesn't really matter

play25:33

okay it doesn't really matter how you

play25:34

write your code so just use winter JS or

play25:37

bun or go or rust or whatever the hell

play25:40

you want to use because it's not going

play25:41

to it's you know 95% of all startups

play25:43

fail anyway so it's not like you're

play25:45

actually getting anywhere you know I

play25:46

hate to tell you this you're dead on a

play25:49

Ral buddy um words hurt man sorry for

play25:54

just sorry for dropping at all only

play25:57

95% what would be a real test in your

play25:59

opinion oh something that's rendering

play26:01

something something that's doing

play26:03

something Ser how about this one simple

play26:06

serving HTM X page with enough elements

play26:09

on it to be useful right like that's not

play26:12

that's not crazy that's like simple

play26:15

right it's easy it's not that bad okay

play26:18

do it then I again I'm not going to

play26:20

spend two hours trying to make this

play26:21

really great example because again I

play26:24

don't care we've already done it I

play26:25

already have YouTube videos doing it if

play26:27

you want to go do it do go go go is

play26:28

faster than typescript one okay I did a

play26:30

whole thing on it we've already looked

play26:32

at this this is already a well

play26:33

understood problem if you don't

play26:35

understand the problem go do a little

play26:38

bit of reading go do a little bit of

play26:39

experimenting yourself doesn't even need

play26:41

oh I was just saying put HTM X in there

play26:43

right do something do a little bit do do

play26:47

like put something in there right

play26:49

YouTube's chat ignored but they got

play26:51

videos this is true YouTube sorry the

play26:54

Bots that destroy my WordPress site at

play26:56

the same time every day are real users

play26:58

the

play26:59

name is Winter's

play27:02

coming JS s Jen

Rate This

5.0 / 5 (0 votes)

関連タグ
Winter JSJavaScript RuntimePerformance BenchmarkNode.jsCloudflareReact Server ComponentsWebAssemblyRust LanguageHigh PerformanceTech Innovation
英語で要約が必要ですか?