News for hackers. Stuff that matters.
[dead]
Re:Firefox's JIT is getting significantly faster by wongarsu on Friday September 25, 2020 @11:28AM (#24590837)
>If only they could merge with V8 progress would actually reach everyone

Having two competing implementations forces both into a performance competition, and encourages work on standards to ensure compatibility. Firefox switching to V8 might help in the short term, but long term it would likely be to the detriment of everyone

Re:Firefox's JIT is getting significantly faster by pizlonator on Friday September 25, 2020 @12:45PM (#24591665)
They should all switch to JSC instead.
Re:Firefox's JIT is getting significantly faster by speedgoose on Friday September 25, 2020 @11:26AM (#24590809)
The last thing I want in my browser is a JVM.
Re:Firefox's JIT is getting significantly faster by coldtea on Friday September 25, 2020 @12:12PM (#24591322)
The brower already has a VM, and from the same people and the same principles who made the Java JVM JIT and the fast Smalltalk one back in the 90s...

Lars Bak, the v8 head:

"In 1994, he joined LongView Technologies LLC, where he designed and implemented high performance virtual machines for both Smalltalk and Java. After Sun Microsystems acquired LongView in 1997, Bak became engineering manager and technical lead in the HotSpot team at Sun's Java Software Division where he developed a high-performance Java virtual machine.".

Re:Firefox's JIT is getting significantly faster by hinkley on Friday September 25, 2020 @01:05PM (#24591854)
I heard at one point that Hotspot had crossed a million lines of code. Looks like V8 is close to 2 million sLOC.

The same source says SpiderMonkey is about 540k sLOC.

Bak has learned a lot of lessons along the way I'm sure, and unless Cliff Click decides to write VMs again (sounds like he's semi-retired, doing something else) then he may be the best person for the job. But nobody's perfect. For me this is Exhibits A-C.

Re:Firefox's JIT is getting significantly faster by remram on Friday September 25, 2020 @12:22PM (#24591440)
The JVM actually had a lot of features that are slowly appearing in JavaScript. Standard bytecode format (like WebAssembly), security/authentication (origin, content security policy)...

One day JS engines will add cryptographic signatures to replace the complex origin rules and they will unify the WebAssembly workflow with the JavaScript code pipeline and we'll have a full JVM again.

Re:Firefox's JIT is getting significantly faster by zozbot234 on Friday September 25, 2020 @12:41PM (#24591627)
> One day JS engines will add cryptographic signatures to replace the complex origin rules

Signed HTTP exchanges might give you that already, AFAICT.

Re:Firefox's JIT is getting significantly faster by sk2020 on Friday September 25, 2020 @12:00PM (#24591194)
Maybe I'm just ignorant, but haven't browsers nearly become just a VM for JavaScript? Rendering documents is sometimes incidental. I'm not sure Swing would actually be worse than HTML5.
Re:Firefox's JIT is getting significantly faster by remram on Friday September 25, 2020 @12:16PM (#24591374)
Layout is actually difficult and offers a great many interesting problems when you try to parallelize it or efficiently use GPU acceleration. There are a lot of constraints and text is difficult to size and render.
Re:Firefox's JIT is getting significantly faster by hinkley on Friday September 25, 2020 @01:25PM (#24592052)
Layout is automated (and hopefully repeatable) typesetting.

The other thing Donald Knuth is famous for is getting so fed up with typesetting for his books, he created a document format to help him keep his sanity. And then went way way down that rabbit hole instead of finishing his book series. One might argue that's not sanity-preserving.

Re:Firefox's JIT is getting significantly faster by foxdev on Friday September 25, 2020 @05:36PM (#24594361)
Sometimes the detour is the journey.
Re:Firefox's JIT is getting significantly faster by The_Colonel on Friday September 25, 2020 @12:25PM (#24591468)
Agreed, layout is probably more difficult problem and definitely the area with more potential for improvements ("forced reflow" anyone?) whereas JS engines are already at the point of quickly diminishing returns.
Re:Firefox's JIT is getting significantly faster by runawaybottle on Friday September 25, 2020 @12:32PM (#24591555)
Could the GeForce 3090 be fast enough to handle it?
Re:Firefox's JIT is getting significantly faster by chungus_khan on Friday September 25, 2020 @01:43PM (#24592223)
An Intel GMA 950 can handle accelerating browsers. It's less about raw power and more about just being able to efficiently split up the workload to get the page rendered and visible in as little time as possible.
Re:Firefox's JIT is getting significantly faster by johnnycerberus on Friday September 25, 2020 @11:46AM (#24591025)
There's already a VM. If Graal really brings better performance then I don't mind.
Re:Firefox's JIT is getting significantly faster by vips7L on Friday September 25, 2020 @02:57PM (#24592983)
I wonder if anyone is already trying to build that. A browser based on graaljs and java rendering engine. I wonder if you could take firefox mobile and do it. I'm assuming its html/css rendering engine is in Java/Kotlin.
Re:Firefox's JIT is getting significantly faster by wenc on Friday September 25, 2020 @12:10PM (#24591289)
We had that in the early days — Java applets. But the paradigm was a little different because they were essentially Java programs and not JavaScript.
Re:Firefox's JIT is getting significantly faster by 1f60c on Friday September 25, 2020 @11:48AM (#24591054)
Why?
Re:Firefox's JIT is getting significantly faster by arghwhat on Friday September 25, 2020 @11:29AM (#24590849)
Pretty sure v8 gets a few orders of magnitude more attention and development resources than jvm and graal.
Re:Firefox's JIT is getting significantly faster by dpratt on Friday September 25, 2020 @11:45AM (#24591006)
You're probably right about Graal, but there is no way that V8 has significantly more effort put into it than the JVM. At best, they're roughly similar, but I suspect that the JVM has quite a bit more development time and effort put into it.
Re:Firefox's JIT is getting significantly faster by The_Colonel on Friday September 25, 2020 @12:21PM (#24591425)
Yep, just work on all those advanced JVM garbage collectors with various performance characteristics and trade offs is unmatched elsewhere in the industry.
Re:Firefox's JIT is getting significantly faster by arghwhat on Friday September 25, 2020 @01:16PM (#24591962)
I did not say that jvm historically hasn't gotten a lot of resources, but any innovation done there has been common knowledge for compiler developers for ages.

V8 gets to benefit from all that research, while simultaneously having far more resources (now as well as for the past many years) to apply it, as well as do more of their own.

Re:Firefox's JIT is getting significantly faster by dpratt on Friday September 25, 2020 @02:39PM (#24592821)
Perhaps I’m misunderstanding you, it seems like you’re implying that the JVM, as of today, isn’t the source of a lot of research or innovation. If that’s true, you’re incorrect. There’s a _gigantic_ amount of money, time and people involved with it, arguably more than there ever has been, and it’s only getting bigger.

While you’re correct that some of the knowledge that came out of building the implementation of the JVM has found its way into V8, there’s still cutting edge work being done into extremely sophisticated JIT complication (with graal, arguably the best in the world) and the recent work on GC is frankly stunning.

With recent JVM versions running zgc, it’s typical to see sub-millisecond GC pauses, and that’s only going to improve as they add more collection outside of safepoints and adding generational logic to it.

Net/net, while you’re correct that there’s a lot of innovation and resources behind v8 today and they’re doing fantastic work as well, don’t discount the JVM.

Yes, Java itself isn’t a hugely interesting language, but the JVM is still arguably one of the most impressive bits of software ever produced and continues to be so.

Re:Firefox's JIT is getting significantly faster by wenc on Friday September 25, 2020 @11:31PM (#24596198)
> There’s a _gigantic_ amount of money, time and people involved with it, arguably more than there ever has been, and it’s only getting bigger.

Just wondering why this is the case? Who are the sponsors for GC research?

(HFT outfits?)

Re:Firefox's JIT is getting significantly faster by pjmlp on Friday September 25, 2020 @12:54PM (#24591744)
Pretty sure you don't know how many JVM implementations are out there since around 2000.

By the way does V8 already handle TB sized heaps with 1ms pause?

Or is able to scale down into embedded devices with hundred KB, while respecting real time constraints?

Or able to have an implementation in JS itself?

Or does V8 cache JIT code across sessions and improves it via additional PGO data gathered across the sessions history?

I am not speaking of the same implementation here, rather a taste of what is out there on the Java world.

Re:Firefox's JIT is getting significantly faster by arghwhat on Friday September 25, 2020 @01:27PM (#24592072)
You are speaking of many different JVM implementations which are all specialized for one purpose.

This is good and all, but splits finite resources even further without a shared benefit, and these variants have as much to do with each other as V8 has to do with Spidermonkey and JScript.

Re:Firefox's JIT is getting significantly faster by pjmlp on Friday September 25, 2020 @02:33PM (#24592763)
Competition is what drives progress.

Monocultures stagnate and deple resources as everyone is happy with good enough.