3,074 questions
0 votes
1 answer
61 views
Why does heavy object cloning degrade JS performance even when using structuredClone compared to manual optimization? [closed]
In a high-performance Node.js service, I noticed that structuredClone() introduces unexpected latency spikes when cloning large nested objects (30–50 KB each). Even switching to manual cloning ...
1 vote
1 answer
84 views
How to call JS code from C++ thread in embedded Node.js/v8 environment
I have Node.js (v22 - I am bound to this version) embedded into my application and exposing a C++ object to its environment. My JS environment setup (based on the docs) runs in a separate thread, like ...
2 votes
1 answer
90 views
How are eliminated values reconstructed during deoptimization in V8?
In Speculative Optimizations for WebAssembly using Deopts and Inlining the following statement is made: The difference is in the code for the slow path. Without deopts, we don’t have the option of ...
0 votes
1 answer
138 views
How to retrieve triggers?
Google Sheets App Script v8: oauthScopes and ScriptApp.getProjectTriggers Update: See reproducible example. App script trigger.gs contains a custom function that is called from the spreadsheet. ...
0 votes
0 answers
38 views
Performance difference between ObjectAssignmentPattern and ArrayAssignmentPattern [duplicate]
is there any performance or optimisation in v8 lvl difference between these two blocks of code? // ArrayAssignmentPattern const [firts, second] = await Promise.all([ fetch('https://api.example.com/...
0 votes
1 answer
68 views
JS execution slower in built chromium binary compared to downloaded chromium binary
I am using puppeteer to run a bunch of JS to process HTML files in headless chromium. I noticed that when I use the Chromium binary downloaded from https://storage.googleapis.com/chromium-browser-...
2 votes
1 answer
84 views
How does the JavaScript engine handle object identity and prototype inheritance between ShadowRealms and the main execution context?
I’m experimenting with the ECMAScript proposal for ShadowRealm and ran into some deeply unintuitive behavior around object identity, function bindings, and prototype inheritance across realms. ...
6 votes
1 answer
187 views
Does JavaScript (V8) optimize concatenation of const strings like Java does?
I’m learning about string concatenation in JavaScript and how it compares to Java. In Java, if you write: final String LET = "a"; final String OOO = "aaaaa"; final String LET_OOO = ...
0 votes
1 answer
187 views
js v8 function inlining
I'm intresed how and in what cases V8 perform inlining. I know that V8 can inline functions to eliminate call cost, but i dont konw the rules for it to happen. I got how it works in obvious cases, ...
2 votes
2 answers
224 views
Does V8 optimize inner functions based on closure values?
For example: function makeFunc(a,b,c,d,e) { return () => { if (a) { /* do something expensive not referencing b,c,d,e */ } if (b) { /* do something expensive not referencing a,c,...
1 vote
1 answer
109 views
js v8 computed property names and inline cache
as far as my understanding go, in v8 if property access occurs on object with persistent shape jit optimize it to prety much struct acces that is just offsetting a pointer but is the same rules ...
1 vote
1 answer
216 views
Updated to Rversion 4.5 - unable to install package `v8`
I have an unexpected issue installing v8 package in a new version of R 4.5under Ubuntu 22.04. This the output of running an install.packages() command in R: I think I tried all possible options of ...
0 votes
1 answer
110 views
v8 Promise 'then' is called only if resolved in constructor
I have following problem with C++/v8 interoperability. When I resolve the promise outside the constructor, the then callback never gets called. Here is the javascript v8 code: 'use strict'; v8log (&...
-2 votes
2 answers
194 views
How to set initial memory size in node 22?
I have a large monolithic application that, when run with --trace-gc, I see a lot of Scavange ... allocation failure, and the memory size increasing incrementally from ~20MB to ~300MB. I know malloc()...
1 vote
1 answer
128 views
What is the order of microtasks in multiple Promise chains?
Out of an academic interest I am trying to understand the order of microtasks in case of multiple Promise chains. I. Two Promise chains These execute in a predictable "zipped" way: Promise....