CommunityNews

CommunityNews

Faster JavaScript Calls

JavaScript allows calling a function with a different number of arguments than the expected number of parameters, i.e., one can pass fewer or more arguments than the declared formal parameters. The former case is called under-application and the latter is called over-application.

In the under-application case, the remaining parameters get assigned the undefined value. In the over-application case, the remaining arguments can be accessed by using the rest parameter and the arguments property, or they are simply superfluous and they can be ignored. Many Web/NodeJS frameworks nowadays use this JS feature to accept optional parameters and create a more flexible API.

Until recently, V8 had a special machinery to deal with arguments size mismatch: the arguments adaptor frame. Unfortunately, argument adaption comes at a performance cost, but is commonly needed in modern front-end and middleware frameworks. It turns out that, with a clever trick, we can remove this extra frame, simplify the V8 codebase and get rid of almost the entire overhead.

We can calculate the performance impact of removing the arguments adaptor frame through a micro-benchmark.

This thread was posted by one of our members via one of our news source trackers.

/js

Where Next?

Popular Frontend topics Top

New
First poster: bot
A beginner’s guide to developing with React. React is a JavaScript user interface (UI) library that was built and is maintained by Faceb...
New
New
AstonJ
By @kobaltz Here’s a related thread about StimulusReflex - an exciting new way to build modern, reactive, real-time apps with Rails.
New
psantos
In this tutorial, I’ll walk you step-by-step on how to install TailwindCSS 2.0 on Ruby on Rails.
New
First poster: bot
How I built a telnet chat server in 2021 with WebAssembly. I love the aesthetics of terminals and I’m not the only one, there is a whole...
New
First poster: dyowee
The key reason why you (and likely most developers) struggle with CSS, is that you underestimate it. Underestimating CSS leads to a stra...
New
First poster: bot
JavaScript is a great programming language, but thanks to the fact that its initial release was built in only ten days back in 1995, coup...
/js
New
First poster: bot
I first got into web design/development in the late 90s, and only as I type this sentence do I realize how long ago that was. And boy, i...
New
First poster: bot
CSS Fingerprinting is a technique of tracking and gathering information on site visitors. This method exploits the nature of CSS to track...
New

Other popular topics Top

axelson
I’ve been really enjoying obsidian.md: It is very snappy (even though it is based on Electron). I love that it is all local by defaul...
New
New
AstonJ
I have seen the keycaps I want - they are due for a group-buy this week but won’t be delivered until October next year!!! :rofl: The Ser...
New
mafinar
Crystal recently reached version 1. I had been following it for awhile but never got to really learn it. Most languages I picked up out o...
New
New
PragmaticBookshelf
Author Spotlight Rebecca Skinner @RebeccaSkinner Welcome to our latest author spotlight, where we sit down with Rebecca Skinner, auth...
New
New
PragmaticBookshelf
Author Spotlight: Peter Ullrich @PJUllrich Data is at the core of every business, but it is useless if nobody can access and analyze ...
New
New
AnfaengerAlex
Hello, I’m a beginner in Android development and I’m facing an issue with my project setup. In my build.gradle.kts file, I have the foll...
New