![]() At this point, we want to thank Google, Mozilla, Microsoft, and Apple - all browser vendors were exceptionally helpful along the way and provided valuable feedback to help improve our benchmark. While WebAssembly is making great progress, when we compare WebAssembly with our JavaScript fallback for the same product and tasks, all browsers except Firefox are still slower.Īfter collecting the first results from our benchmarks, we reached out to the individual browser vendors to discuss these results and investigate ways to further improve the numbers. The results were a bit surprising at first. This is a factor where asm.js excels, as it only needs to compile functions when they are actually run. We want our PDF viewer to deliver the best results no matter the device. Much of the size of our WebAssembly artifact is attributed to special cases in the PDF spec that might not be executed for every document. Our WebAssembly payload is also rather unusual. We want a score that can easily be compared across a wide variety of browsers, and to make this possible, we had to remove the network speed noise from the equation. This makes it harder to compare between the WebAssembly results and our JavaScript-fallback 1 results, as the latter can’t use this optimization. As such, the benchmark does not call directly into WebAssembly rather, it also tests the bridge we use to communicate with it - an important part of PSPDFKit for Web.Īdditionally, we had to disable one of the major improvements to WebAssembly startup time: streaming compilation. ![]() One thing we’re trying to accomplish with this benchmark is to have a score we can use to improve the performance of PSPDFKit for Web instead of creating a microbenchmark. Considerationsīefore we dive right into analyzing our results, we want to share more details about our test setup. We group individual results into two different buckets: loading time (compilation and instantiation) and run time, because we see compile times as the biggest differentiators when looking at different browsers. Using the Web Performance API, we measure the time of various standard actions on a PDF document. The benchmark is a simple JavaScript application that runs in the browser. ⏱ Get Your PSPDFKit WebAssembly Score Now Browser vendors can reach out to us and obtain a more permissive license key so that the benchmark can run on different machines and even on their continuous integration servers. The benchmark is available on GitHub and works with both customer and trial licenses. A Real-World WebAssembly BenchmarkĪs part of our goal to make WebAssembly faster, we created a WebAssembly benchmark, which offers browser vendors a real-world, open source benchmark for WebAssembly based on PSPDFKit for Web. This starts with optimizing WebAssembly startup time, compiler improvements, and continuous browser upgrades. Performance of the WebAssembly code has been a focus for us since day one, and it’s amazing to see the entire industry move toward a shared goal: making WebAssembly fast. It wouldn’t be feasible for us to rewrite the equivalent of 500,000 lines of C++ code to JavaScript, but technologies such as WebAssembly and asm.js allow us to use the same codebase in a browser, delivering a consistent level of high-fidelity rendering and parsing of PDF documents everywhere. Rendering PDF documents is a complex task: The format is 25 years old and has many edge cases. This was a big achievement for us as a company, and being able to provide a browser-only solution that doesn’t require any backend infrastructure lowers the barrier to entry for our customers. Only a few months later, we released an updated version of PSPDFKit for Web - one that doesn’t require a server component and instead uses WebAssembly (Wasm, WA) to render documents directly in the browser. In late 2016, we released the first version of our Web SDK, which relies on a server component to render documents. PSPDFKit’s mission is to provide the best way to view, annotate, and fill out forms in PDF documents on any platform.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |