Automatic Inlining in JavaScript Engines

.

Back when JavaScript interpreters were still slow, avoiding a function call inside a performance-critical code was very much recommended. With the recent improvements to the modern JavaScript engines, this practice becomes less relevant. One important feature which reduces the need to worry about function call overhead is automatic function inlining. Consider the following code: function… Read more »

CSS Preload Scanner in WebKit

.

In WebKit world, preload scanner refers to a side parser which kicks in if the main HTML parser is halted by a blocking script loading. Because this preload scanner can see what other resources (e.g. stylesheets, images, inputs) are to be fetched, it can trigger the associated network requests as early as possible, without waiting… Read more »

JavaScript Performance Analysis: Sampling, Tracing, and Timing

.

Performance optimization of web applications is a hot topic these days. One of the related areas is of course optimizing the application code itself. For client-side application running in the web browser, this means speeding-up JavaScript code whenever possible. Premature optimization is not a good practice, it is crucial to locate which parts cause the… Read more »

Determining Objects in a Set: Examples in JavaScript

.

In practical programming, it is quite common to determine whether an object belongs to a set or not. For example, if you implement a spell checker, it is essentially a comparison against the set of all correctly-spelled words. If the set itself is fixed and it never changes, what are the approaches we can use?… Read more »

Mac OS X: Tracking Disk I/O Activities

.

Many modern laptops come with an SSD (solid-state drive) instead of a traditional magnetic disk. Because it is silent, it is not possible to hear the spinning sound anymore as the disk enters a period of high activities. This can be bad, often a continuous I/O access indicates a problem in the running system. For… Read more »

Lazy Parsing in JavaScript Engines

.

Modern JavaScript engines can defer the parsing process of a function body until it is completely needed. Why is this done and how does this work? The last blog post titled Advances in JavaScript Performance in IE10 and Windows 8 from the Internet Explorer team mentions the use of deferred parsing to improve the performance…. Read more »