Live data from Hacker News

Not So Fast: Analyzing the Performance of WebAssembly vs. Native Code

usenix.org

51–60 of 212 posts

Re: Not So Fast: Analyzing the Performance of WebAssembly vs. Native Code

#51
Please actually read the paper. As usual, the mean is a poor approximation of a distribution. This paper states repeatedly that it was able to reproduce the experimental results from the 2017 PLDI paper, which primarily used PolyBenchC as the suite. My team wrote that paper. We didn't cherry pick.

The issue is mostly that we suck more on Spec2k6 than we realized. Since publishing that paper we do track Spec2k6 internally but we don't spend time tuning for it.

/v8 wasm runtime TL

Re: Not So Fast: Analyzing the Performance of WebAssembly vs. Native Code

#52

Can someone explain a concrete use case for web assembly? Are there projects out there using web assembly in production? What kind of application needs more performance than Javascript can offer, but doesn't need full native performance?

Beta of Google Earth is Wasm.

Re: Not So Fast: Analyzing the Performance of WebAssembly vs. Native Code

#53

Can someone explain a concrete use case for web assembly? Are there projects out there using web assembly in production? What kind of application needs more performance than Javascript can offer, but doesn't need full native performance?

Unity 3D targets Web Assembly now for the web, which makes much more sense than JavaScript, even if asm

Re: Not So Fast: Analyzing the Performance of WebAssembly vs. Native Code

#54

Slower at an average of 50% looks acceptable to me for many applications. However, for me personally I wonder: what's the point? I would go from Linux -> glibc -> native application to Linux -> glibc -> Web Browser -> WebAssembly application. Yet another layer of abstraction. Sure, WebAssembly can be run directly on any platform. But precompiling an application is not a problem (my Linux distribution provides binary…

The point is obviously that web apps can be directly competitive with binaries, sans the same level of security, given they operate a lite version of the application. This makes it theoretically possible to run everything via cloud, if you didn't already see that coming.

This makes it theoretically possible to run everything via cloud, if you didn't already see that coming.

Yes. But my question is why would I want this? I won't own the software anymore. The web has shown over and over again to have far less privacy. The vendor could disappear, change their terms, change their fees any time. As a customer/user you become basically powerless.

And for non-cloud applications: what's the point. My distribution already compiles and provides most of the software that I need and my machine doesn't need to waste time/energy on JITing.

Re: Not So Fast: Analyzing the Performance of WebAssembly vs. Native Code

#55

Can someone explain a concrete use case for web assembly? Are there projects out there using web assembly in production? What kind of application needs more performance than Javascript can offer, but doesn't need full native performance?

The Internet Archive has a ton of in-browser emulators that can boot many old computers and arcade cabinets in the browser. https://archive.org/details/msdos_Oregon_Trail_The_1990

Not all of these will boot, but most will. https://archive.org/details/softwarelibrary & https://archive.org/details/internetarcade

Re: Not So Fast: Analyzing the Performance of WebAssembly vs. Native Code

#56
post #26

Earlier quoted context omitted.

Because this time around we will have instant (no install) apps that are inherently sandboxed? Seems like a pretty big win to me.

We already had "instant (no install) apps that are inherently sandboxed": Java and its net-top boxes. Why didn't it work?

Java applets came about in the days of 486s. They had huge startup time, were usually in a tiny little window, and everyone was starting from scratch with few libraries and drawing primitives. There was no webgl or compiling of existing UI programs into webasm with emscripten.

Re: Not So Fast: Analyzing the Performance of WebAssembly vs. Native Code

#57
post #15

Tl;dr: 2x slower in FF, 2.5x slower in chrome. Depending on the application, that doesn't seem to be a huge tradeoff. Certainly many developers are comfortable writing things in python, which is likely hundreds of times slower than C++ in many problem spaces. TBH though my big hope for web assembly has nothing to do with the web at all, but as a distribution format for drivers that can be installed on any cpu arch/ke…

Globally compatible drivers is a pipedream, because the problem is not that the machine architecture is different but that the API they interact with is fundamentally different. Unless everyone agrees on some sort of standard like NDIS, but Linux has more or less promised never to have a stable API.

well sure, but in this hypothetical future, someone has added the ability to load wasm files as drivers, and the API that that functionality exposes _could_ be stable.

Re: Not So Fast: Analyzing the Performance of WebAssembly vs. Native Code

#58

Tl;dr: 2x slower in FF, 2.5x slower in chrome. Depending on the application, that doesn't seem to be a huge tradeoff. Certainly many developers are comfortable writing things in python, which is likely hundreds of times slower than C++ in many problem spaces. TBH though my big hope for web assembly has nothing to do with the web at all, but as a distribution format for drivers that can be installed on any cpu arch/ke…

A difference to Python is that Python has the escape hatch with native modules. A PyQt application as arbitrary example relies on native code for doing most of the handling and only some small parts of business logic have to be done in Python. With WebAssembly the Qt stuff is compiled to WebAssembly as well and therefore suffers from the slowdown as well. Only the actual rendering can be offloaded to WebGL and hardware. (Still we were able to write snappy UIs more than a decade ago, where systems were a lot slower so for many cases that should be fine)

Re: Not So Fast: Analyzing the Performance of WebAssembly vs. Native Code

#59
post #45

Earlier quoted context omitted.

> Why do we - developers fall into this trap? Regardless of is this a trap or not, it's obvious to me that developers want simplicity and consistency. WA provides both so don't wonder why it's taking off. > So instead of Linux/Windows/OSX we will have Firefox/Safari/Chrome/Whatever all with their own implementation gotchas I let the compilers worry about this :)

Yeah, right. Compilers do not deal with the difference in presence / absence and different implementations of various features on different platforms, be it native OS or Browser OS.

Is that so? Worst case I can imagine is to have the same compiler emit app-firefox.wasm and app-chrome.wasm binaries from the same codebase, but I think this is highly unlikely.

But there probably always will be a safe flag that generates everywhere running binaries.

Re: Not So Fast: Analyzing the Performance of WebAssembly vs. Native Code

#60
post #27

Earlier quoted context omitted.

Because this time around we will have instant (no install) apps that are inherently sandboxed? Seems like a pretty big win to me.

Webassembly is not magic. You still have to download and possibly cache code and assests. Call it install or not. I think win is having free software or at least opensource apps that are trusted by distributors and easy to analyze/modify, and actually own (meaning have on your harddrive and fully control). And we already have that win.

WebAssembly doesn’t support all the things that require installation. There is no integration, the apps can’t register for extensions, they can’t hook other programs. Most of this integration is only marginally useful anyway but people did need iOS, a popular OS that just does not support that kind of thing, to see it.
Post reply on HN