
Wasm vs. PNaCl Performance Benchmark - jjohansson
https://www.pdftron.com/blog/wasm/wasm-vs-pnacl/
======
jjohansson
Here's a direct link to the client-side benchmark tool to test your own
documents and pull numbers directly:

[https://www.pdftron.com/benchmarks/pnacl-vs-
wasm/](https://www.pdftron.com/benchmarks/pnacl-vs-wasm/)

Note that it only works in Chrome b/c it's the only browser that supported
PNaCl (recently deprecated). Edge Beta (with chromium underneath) is buggy, so
best not to use it for this tool.

~~~
MuffinFlavored
> PNaCl's speed is 1.95 times faster than WASM

> MacBook Pro (13-inch, 2017, Four Thunderbolt 3 Ports)

I wonder why PNaCL was deprecated if it is faster in run-of-the-mill
situations?

~~~
leftyted
It only works in Chrome, which is a pretty big issue.

Per wikipedia [0], other browsers rejected PNaCL because they don't like the
idea of web apps running binaries as that represents a black box for most
users. In comparison, wasm is "more open". Wasm code has a human-readable text
equivalent (although, frankly, the number of people who will be able to make
sense of it is not high and doesn't include me).

[0]
[https://en.wikipedia.org/wiki/Google_Native_Client#Detractor...](https://en.wikipedia.org/wiki/Google_Native_Client#Detractors)

~~~
mintplant
(P)NaCl was also essentially defined by Chromium's implementation, so
difficult to reproduce from scratch; and tightly intertwined with the
surrounding Chromium codebase, so that implementation was difficult to port to
other browsers. Its success depended on a total Chromium monoculture.

~~~
kevingadd
Another problem was compile times - getting an efficient emit and compile time
for LLVM IR was difficult and involved having to heavily optimize/replace lots
of parts of LLVM's pipeline that were never designed for turbo speed because
it wasn't a priority.

------
tonto
Some of the things with javascript PDF renderers overlaps with what we do in
bioinformatics (we make http range requests from large binary data files
similar to this article's 7gb "linearized" pdf) so it's cool to see what
techniques they're using on the bleeding edge

------
ReD_CoDE
I'm not a programmer, so Wasm is DOM-based or Canvas-based? I mean does it
support explicit DOMs?

~~~
yoklov
Neither really. It doesn’t have direct access to a canvas API or to the DOM,
but you can proxy calls through javascript. There’s a plan to allow avoiding
this overhead, but it’s fairly early.

