Questions tagged [v8]

V8 is Google's open source JavaScript engine.

About V8

V8 is Google's Javascript engine that is used in Google Chrome (). It is written in C++ (), and is open source, which can be checked out by following the instructions on the v8 wiki.

V8 can run standalone, or can be embedded into C++ applications.

Documentation on V8 can be found on its wiki pages.

There are a number of flags that can be passed to V8 to expose its internals. For instance, --trace-deopt gets V8 to log code deoptimizations, and --expose-gc allows scripts to manually invoke a garbage collection. The full list of flags can be found by reading the source.

Links:

Tag Usage

Use this tag to ask questions about:

  • Usage of the V8 API
  • Performance and profiling with V8
  • How V8 works
2955 questions
1
vote
1 answer

V8 engine no longer breaks on errors

This issue has been reported to Google: https://issuetracker.google.com/issues/152948662 A short description of the issue In the Rhino runtime, the script debugger (script.google.com) would break on any line containing an error (handled or not) if…
1
vote
1 answer

using R to web scrape data from javascripted download button

I am trying to web scrape the csv generated by clicking the 'CSV' button on this site (located below the left side of the graph). The problem is that the CSV is generated from Javascript that parses the embedded table (below middle of graph). I am…
StarScream2010
  • 241
  • 1
  • 5
1
vote
1 answer

Why does sorting 32-bit numbers using JavaScript so much faster than sorting 33-bit numbers?

The following code simply creates an array and sort it. It is very strange that on my 2013 Macbook Pro, it took 5.8 seconds to sort the 30-bit numbers: n = 10000000; numMax = 1000000000; console.log(`numMax is how many bits:…
nonopolarity
  • 146,324
  • 131
  • 460
  • 740
1
vote
1 answer

Unable to build V8 in Windows 10

I'm using this link as reference (https://medium.com/angular-in-depth/how-to-build-v8-on-windows-and-not-go-mad-6347c69aacd4) to build v8 but i think its out of date or i'm doing something wrong. I can't run this (ninja -C out.gn/x64.release)…
SunoKuni
  • 37
  • 6
1
vote
1 answer

Why is my while loop getting logged this way?

Why is my while loop getting logged this way? Is it because the internal workings of V8 and SpiderMonkey differ? var counter = 0; while (counter <= 10) { console.log(counter); counter++; } Note: Try the above code in a Chrome and a Firefox…
GiftedGeek
  • 13
  • 5
1
vote
1 answer

Use d8 functions in Nodejs

Today I decided to compete in an online programming contest using JavaScript for the first time but It got me in trouble! My local version of Nodejs was v10.16.1 but the online judge used V8 JavaScript engine. Until today I thought Nodejs uses V8 as…
mrzrm
  • 926
  • 7
  • 19
1
vote
2 answers

Search Pattern Error since Google Scripts V8 Update

Ever since google forced the update "This project is running on our new Apps Script runtime powered by Chrome V8." I'm getting the following error and I don't understand why. "Exception: Invalid argument: searchPattern at…
Dave
  • 11
  • 3
1
vote
1 answer

Issue with scopes when switching Google Apps Script projects to V8 runtime

Due to Google Apps Script forcefully pushing "Rhino" to "V8" engine, Applications are moving from Rhino to V8 automatically. So our applications are asking "scopes" that need to be specified manually in "appscript.json" file. Please check the below…
1
vote
1 answer

HTML Service does not open a sidebar in V8 runtime

I have a very large project running on Rhino, but when I switch it to V8 one of the basic functionalities breaks - the sidebar in Google Sheets can no longer be opened. Basic architecture: A) Google Sheet A with a script (Rhino) importing a GAS…
Ivan Pekarik
  • 101
  • 1
  • 9
1
vote
2 answers

Does Javascript file size impact parsing time on browser? Will two 5kb JS files be parsed faster than a single 10kb or vice-versa?

I don't know much about JS parsing or performance. But I would like to know if there is a performance difference when the browser parses a large file, vs smaller ones with the same total size. What parses faster: 10kb vs. (2 x 5kb) Does it matter?…
cbdeveloper
  • 27,898
  • 37
  • 155
  • 336
1
vote
2 answers

Google Apps Script (V8); why can't I use an object instance inside of onOpen?

Why can't I use an object instance inside of onOpen? I'm experimenting with Google Apps Script using the new V8 runtime. I wrote some simple code which makes an instance of a class in the onOpen function and tries to associate a call to a method on…
Vince
  • 3,962
  • 3
  • 33
  • 58
1
vote
1 answer

Memory allocation of for the same objects in different arrays

I'm trying to understand how JS engines like V8 handle objects in arrays and specifically how is memory allocated and is it efficient. I have an array that is with objects not sorted and I produce an array that has those same objects in a sorted…
George Kouzmov
  • 319
  • 4
  • 15
1
vote
1 answer

Profiling for Node.js Application

I followed this link https://nodejs.org/uk/docs/guides/simple-profiling/, to profile a particular endPoint in my app (Expressjs). The endpoint will download a pdf from s3 , use a thread pool ( a pool of 4 worker_threads) to fill the pdf with data…
Mu-Majid
  • 851
  • 1
  • 9
  • 16
1
vote
1 answer

Is there a way to covert a v8 function to a normal function usable by windows signals?

Is there a way to convert from 'v8::Local' to 'void (int)'. I have a v8 function and I'm trying to pass it into signal on windows. v8::Local function; function = v8::Local::Cast(args[1]); (void)signal(SIGINT,…
Alex
  • 131
  • 2
  • 13
1
vote
2 answers

Event loop - Infinte loop won't stop rendering pipeline in Chrome but it will on Firefox

In the following codepen the "stop earth" button initiates an infinite loop. I was expecting that the loop will prevent the browser from initating the rendering pipieline but I was surprised to see that in Chrome the gif continues smoothly. When…
amirNamdar
  • 31
  • 7
1 2 3
99
100