Skip

Compile JavaScript to WASM for Web Performance Improvement

By Shi Ling (Huawei)

See also the slides.

Skip

Transcript

The title of my Lightning Talk is Compile JavaScript to WASM for Web Performance Improvement.

Here, I will introduce the background of the project, and the results we achieved.

There will also be a breakout session tomorrow.

Everyone is welcome to discuss.

Okay, nowadays, web technology has been widely used in many applications.

As you can see, the main page of the applications are developed by web technology and some of the experience of the webpages is close to native.

Here, you can see the history of application-oriented web technology.

Firstly, we're focused on the enriching device APIs and improving application frameworks.

Later, the performance of web in application scenario has been gradually concerned.

Many application frameworks have emerged for performance issues.

From a completely perspective of web application development, developers use the front-end frameworks to develop apps.

The front-end frameworks use the unified DOM APIs to interact with the web runtime.

The current web runtime may not just be a form of WebView, but an application runtime that can execute the limited DOM APIs.

However, when the developers' business code is considered together, there's still limited optimization method.

So to speed up the business code, it can only be performed at the engine level.

The emergence of the WebAssembly technology allows us to break out, to break through the speed network, to break through the speed bottleneck of JavaScript engine.

Here's an ideal web application development model.

In the development stage, developers can use JavaScript or TypeScript to develop applications for efficiency.

But while in the running stage, web applications and the whole framework and the related libraries can be complied to WASM for performance.

So, JWST is a JavaScript-to-WASM Static Translator.

It's an attempt in this direction.

This project is developed by Huawei Technology and Beihang University.

So, we use QuickJS code, QuickJS bytecode as input, and output LLMV IR. In some case, WebAssembly code generated by JWST is 30% to 50% faster than node.js for the first execution.

Here is JWST compilation, the whole compilation of process.

As we can see, we use QuickJS bytecode as the input, and then compile it to WASM.

Here is a React Native testing case.

It's a demo video that shows the...

It's a demo video that shows the, the JWST has in a pay generation step.

It can sometimes take over the V8 JavaScript engine.

Okay.

If you are interested in this, welcome to continue this discussion on tomorrow's breakout session.

Thank you, thank you for listening.

Skip

Sponsors

Support TPAC 2023 and get great benefits from our Sponsorship packages.
For further details, contact sponsorship@w3.org

Silver sponsor

Gooroomee

Bronze sponsors

Sttark Igalia

Inclusion fund sponsors

TetraLogical Services University of Illinois Chicago Igalia