Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

145
Views
How to get actual invocation count of a optimized function in V8

Every function has a property invocation_count in FeedbackVector to record the number of times the function was called. But after a function is optimized, its invocation count will not be increased when I call this function again. Is there any way to get the invocation count or update the invocation count attribute in FeedbackVector after a function has been optimized?

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

(V8 developer here.)

No, there isn't. Optimized functions don't count how often they've been called (because they have no reason to; having them update a counter would be a waste of time).

If you really care, you have two options:

(1) You could add counters in the JavaScript source of the function(s) in question:

var myFuncCalled = 0;
function myFunc() {
  myFuncCalled++;
  // rest of the function's code...
}

And dump those counters at the end of the program.

(2) You could modify V8 to make optimized code update the count in the feedback vector. Off the top of my head I'm not sure how exactly you'd do that, but it's certainly possible. (We wouldn't want to upstream such a patch, this would be just for your local experimentation.)

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!