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

AstonJ
Haven’t watched it yet but posting it and bookmarking the thread :nerd_face: TypeScript continues to soar in popularity…
New
New
First poster: bot
You can write fast, modern, responsive web applications by generating your HTML on the server, and delivering that (with a little help) d...
New
First poster: bot
The Tower of Hanoi is a classic mathematical puzzle that is often used as an introduction to recursion. We can express a solution to this...
New
First poster: bot
Backend languages in the browser have been a thing for a long time. Google Web Toolkit would compile Java applications into JavaScript, a...
New
First poster: bot
User-preference based media features, container queries, and media queries for new screen types, such as foldable screens, will enable us...
New
First poster: rustkas
What is TCO? Tail-call optimization (TCO) is a very neat trick that the Elm compiler does to make recursive functions a lot more performa...
New
First poster: bot
Implementing an app redesign is never routine nor easy. Two weeks after I was hired at Polytomic, I began implementing the app’s first re...
New
First poster: bot
Recently Tom MacWright has written a few posts on Single Page Applications and their discontents: Second-guessing the modern web If not...
New
First poster: bot
Why in 2021 would you bother making a website without js? While researching this post I found two really great sources of information. S...
/js
New

Other popular topics Top

AstonJ
SpaceVim seems to be gaining in features and popularity and I just wondered how it compares with SpaceMacs in 2020 - anyone have any thou...
New
Margaret
Hello content creators! Happy new year. What tech topics do you think will be the focus of 2021? My vote for one topic is ethics in tech...
New
AstonJ
If you are experiencing Rails console using 100% CPU on your dev machine, then updating your development and test gems might fix the issu...
New
PragmaticBookshelf
Build highly interactive applications without ever leaving Elixir, the way the experts do. Let LiveView take care of performance, scalabi...
New
AstonJ
Saw this on TikTok of all places! :lol: Anyone heard of them before? Lite:
New
New
PragmaticBookshelf
Author Spotlight Jamis Buck @jamis This month, we have the pleasure of spotlighting author Jamis Buck, who has written Mazes for Prog...
New
PragmaticBookshelf
Author Spotlight Mike Riley @mriley This month, we turn the spotlight on Mike Riley, author of Portable Python Projects. Mike’s book ...
New
DevotionGeo
I have always used antique keyboards like Cherry MX 1800 or Cherry MX 8100 and almost always have modified the switches in some way, like...
New
AstonJ
If you’re getting errors like this: psql: error: connection to server on socket “/tmp/.s.PGSQL.5432” failed: No such file or directory ...
New