Mathias Bynens

About me

Hi there! I’m Mathias. I work on Chrome DevTools and the V8 JavaScript engine at Google. HTML, CSS, JavaScript, Unicode, performance, and security get me excited. You can follow me on Twitter, Mastodon, and GitHub.

Latest notes

A horrifying globalThis polyfill in universal JavaScript

Published · tagged with JavaScript

The globalThis proposal introduces a unified mechanism to access the so-called “global object” a.k.a. “the global” in any JavaScript environment. It sounds like a simple thing to polyfill, but it turns out it’s pretty hard to get right.

Continue reading “A horrifying globalThis polyfill in universal JavaScript”…

JavaScript engine fundamentals: optimizing prototypes

Published · tagged with JavaScript, performance

This article explains JavaScript engine optimization pipeline trade-offs, and describes how engines such as V8 speed up accesses to prototype properties. As a JavaScript developer, having a deeper understanding of how JavaScript engines work helps you reason about the performance characteristics of your code.

Continue reading “JavaScript engine fundamentals: optimizing prototypes”…

JavaScript engine fundamentals: Shapes and Inline Caches

Published · tagged with JavaScript, performance

This article describes some key fundamentals that are common to all JavaScript engines — and not just V8, the engine the authors work on. As a JavaScript developer, having a deeper understanding of how JavaScript engines work helps you reason about the performance characteristics of your code.

Continue reading “JavaScript engine fundamentals: Shapes and Inline Caches”…

Asynchronous stack traces: why await beats Promise#then()

Published · tagged with JavaScript, performance

Compared to using promises directly, not only can async and await make code more readable for developers — they enable some interesting optimizations in JavaScript engines, too! This write-up is about one such optimization involving stack traces for asynchronous code.

Continue reading “Asynchronous stack traces: why await beats Promise#then()”…

ECMAScript regular expressions are getting better!

Published · tagged with JavaScript, Unicode

This article highlights what’s happening in the world of JavaScript regular expressions right now. Spoiler: it’s quite a lot — there are more RegExp-related proposals currently advancing through the TC39 standardization process than there have been updates to RegExp in the history of ECMAScript!

Continue reading “ECMAScript regular expressions are getting better!”…

Older notes

Browse the archive.