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

291
Views
Tail recursion optimized javascript code performance worse than non optimization, it's counterintuitive,Is it because the compiler doesn't optimize?
function factorialNormal(n) {
  if (n === 1) {
    return n
  }
  return n + factorialNormal(n - 1)
}
function factorialWithTail(n, acc) {
  if (n === 1) return acc;
  return factorialWithTail(n-1, n + acc)
}

recursion function is fast than tail-recursion and the tail use more memory, causing the maximum call stack

enter image description here

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

0

There is no TCO on V8 currently.

Here is the tracking ticket for this feature.

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!