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

First Post!

bot

bot

Corresponding tweet for this thread:

Share link for this tweet.


Related portal:

Popular Frontend topics Top

First poster: bot
How I Write Elm Applications. This is the homepage of Jezen Thomas — programmer, and founder of NewBusinessMonitor and Comparestack. Top...
New
First poster: bot
PDF documents are a major part of our digital lives and, in an era where we spend most of our time working inside a web browser, enhancin...
New
CommunityNews
As JavaScript developers, the sheer amount of stuff we’re expected to know is enormous, and it grows bigger every day. With so many diff...
New
First poster: bot
Choosing a language to replace Javascript (and why it’s F#). This is an opinion piece. YMMV Once in a while, I start a side project who...
New
First poster: bot
Humio software engineers Thomas Anagrius and Jeroen Engels sat down to talk about why they got involved with Elm for web-based front-end ...
New
First poster: AstonJ
;; This is an animated & interactive guide to ;; building a game in ClojureScript, because ;; I find the design patterns very intere...
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
New
First poster: davearonson
What is surprising is that a 14kB page can load much faster than a 15kBpage — maybe 612ms faster — while the difference between a 15kB an...
New
ragamuf
A little halloween hocus-pocus on the value proposition of having a reliable test suite in place. You are not scared, are you?
New

Other popular topics Top

Devtalk
Hello Devtalk World! Please let us know a little about who you are and where you’re from :nerd_face:
New
Exadra37
Please tell us what is your preferred monitor setup for programming(not gaming) and why you have chosen it. Does your monitor have eye p...
New
dasdom
No chair. I have a standing desk. This post was split into a dedicated thread from our thread about chairs :slight_smile:
New
AstonJ
Thanks to @foxtrottwist’s and @Tomas’s posts in this thread: Poll: Which code editor do you use? I bought Onivim! :nerd_face: https://on...
New
PragmaticBookshelf
Learn different ways of writing concurrent code in Elixir and increase your application's performance, without sacrificing scalability or...
New
PragmaticBookshelf
Build highly interactive applications without ever leaving Elixir, the way the experts do. Let LiveView take care of performance, scalabi...
New
Margaret
Hello everyone! This thread is to tell you about what authors from The Pragmatic Bookshelf are writing on Medium.
1127 25299 748
New
AstonJ
If you want a quick and easy way to block any website on your Mac using Little Snitch simply… File > New Rule: And select Deny, O...
New
husaindevelop
Inside our android webview app, we are trying to paste the copied content from another app eg (notes) using navigator.clipboard.readtext ...
New
PragmaticBookshelf
Author Spotlight: Bruce Tate @redrapids Programming languages always emerge out of need, and if that’s not always true, they’re defin...
New

Latest in Blogs/Talks

View all threads ❯