Live data from Hacker News

Introducing the B3 JIT compiler

webkit.org

11–20 of 131 posts

Re: Introducing the B3 JIT compiler

#11

Earlier quoted context omitted.

> Compilers are sexy, but they're very much a solved problem. Not for all of the other widely-used languages that still have incredibly simple interpreters. Think how much energy could have been saved if Ruby, Python, and PHP were all as fast as your average JS engine.

Exactly. Ruby would probably have massive adoption with JS-like speed.

ajross is right. People choose the languages they like regardless of performance.

JS perf is important to users though. Faster execution means fewer watts spent rendering and interacting with your favorite web page.

(Fun fact: B3's backend contains a machine description language that gets compiled to C++ code by a ruby script, opcode_generator.rb. We use Ruby a lot.)

Re: Introducing the B3 JIT compiler

#12

Earlier quoted context omitted.

Gutsy move indeed. Though I wonder, what was the development cost in real life cash for gaining those 5% of performance?

3 months. Two people working on it (me and @awfulben).

Nice work, Fil. Looks cool.

Re: Introducing the B3 JIT compiler

#13

Really cool article. Posts like this always make me wonder what the state of the programming would be if browsers hadn't sucked up almost all of the world's compiler optimizers.

While they have sucked up a lot, it is far from certain all would have been employed optimizing compilers if that hadn't happened. Demand tend to create the supply.

Also, many of the improvements done for JS will certainly trickle down to Python, Ruby, PHP eventually.

Re: Introducing the B3 JIT compiler

#14
post #9

Earlier quoted context omitted.

Exactly. Ruby would probably have massive adoption with JS-like speed.

Ruby has massive adoption, as do Python and Perl and PHP. Environments with objectively better performance like the JVM and .NET have not, in fact, done all that well comparatively in this environment (which is to say they've done fine too and achieved "massive" adoption, just not that much better than their slower competitors). In fact, looking at the market as it stands right now I'd say that performance concerns a…

Considering the massive speed improvements we have been seeing in Javascript, but also languages like Ruby, I'd say compilers is a solved problem for staticly compiled languages, but perhaps not as much for interpreted highly expressive languages.

Re: Introducing the B3 JIT compiler

#15

Really cool article. Posts like this always make me wonder what the state of the programming would be if browsers hadn't sucked up almost all of the world's compiler optimizers.

They're solving a non-issue. The rest of the world is perfectly fine with the statically typed, well designed languages that are easy to compile. And only the web world is so obssessed with smart compilers compensating (impressively, but still far from being sufficient) for multiple deficiencies in the language design.

Re: Introducing the B3 JIT compiler

#16
post #4

Really cool article. Posts like this always make me wonder what the state of the programming would be if browsers hadn't sucked up almost all of the world's compiler optimizers.

To be fair, GPU vendors sucked up a ton too. But considering that optimized scalar code performance has moved, what, maybe 40% over the last two decades, I'm going to say "not much". Compilers are sexy, but they're very much a solved problem. If we were all forced to get by with the optimized performance we saw from GCC 2.7.2, I think we'd all survive. Most of us wouldn't even notice the change.

> Most of us wouldn't even notice the change.

A 40% decrease in optimization is enough to drop framerates from 60fps to 30fps easily, so I'm pretty sure we would notice it.

Re: Introducing the B3 JIT compiler

#17
post #7

Earlier quoted context omitted.

> Compilers are sexy, but they're very much a solved problem. Not for all of the other widely-used languages that still have incredibly simple interpreters. Think how much energy could have been saved if Ruby, Python, and PHP were all as fast as your average JS engine.

Lately quite a few apps are saving energy by moving from Ruby/Python/PHP to Go.

And Go proves munificent's point: it doesn't have many compiler optimizations either. (This may change with the WIP SSA backend, but the point remains that Go gained huge popularity in spite of having a non-optimizing compiler.)

Re: Introducing the B3 JIT compiler

#18
post #15

Really cool article. Posts like this always make me wonder what the state of the programming would be if browsers hadn't sucked up almost all of the world's compiler optimizers.

They're solving a non-issue. The rest of the world is perfectly fine with the statically typed, well designed languages that are easy to compile. And only the web world is so obssessed with smart compilers compensating (impressively, but still far from being sufficient) for multiple deficiencies in the language design.

> The rest of the world is perfectly fine with the statically typed, well designed languages that are easy to compile.

Python, Ruby, PHP, and Perl aren't "the rest of the world"? As far as compilers are concerned, all of those languages have more troublesome semantics than JavaScript does.

> And only the web world is so obssessed with smart compilers compensating (impressively, but still far from being sufficient) for multiple deficiencies in the language design.

You have no idea how much compilers have to compensate for the deficiencies in C and C++'s design.

Re: Introducing the B3 JIT compiler

#19

Earlier quoted context omitted.

Gutsy move indeed. Though I wonder, what was the development cost in real life cash for gaining those 5% of performance?

3 months. Two people working on it (me and @awfulben).

Ok, thats impressive. I'll show myself out.

Re: Introducing the B3 JIT compiler

#20

Earlier quoted context omitted.

Gutsy move indeed. Though I wonder, what was the development cost in real life cash for gaining those 5% of performance?

3 months. Two people working on it (me and @awfulben).

Great work! Time to update... https://en.wikipedia.org/wiki/WebKit#JavaScriptCore
Post reply on HN