OiO.lk Community platform!

Oio.lk is an excellent forum for developers, providing a wide range of resources, discussions, and support for those in the developer community. Join oio.lk today to connect with like-minded professionals, share insights, and stay updated on the latest trends and technologies in the development field.
  You need to log in or register to access the solved answers to this problem.
  • You have reached the maximum number of guest views allowed
  • Please register below to remove this limitation

OptimizeFunctionOnNextCall() and PrepareFunctionForOptimization() + OptimizeFunctionOnNextCall()

  • Thread starter Thread starter Beginner
  • Start date Start date
B

Beginner

Guest
What is the difference between using '%OptimizeFunctionOnNextCall()' alone and using '%OptimizeFunctionOnNextCall()' accompanied with '%PrepareFunctionForOptimization()'?

Code:
function test() {
    // some code here to optimize
}

%OptimizeFunctionOnNextCall(test);
test();

// ./d8 test.js --allow-natives-syntax --trace-turbo --trace-turbo-path turbo_out --trace-turbo-filter test

Code:
function test() {
    // some code here to optimize
}

%PrepareFunctionForOptimization(test);
test();
%OptimizeFunctionOnNextCall(test);
test();

// ./d8 test.js --allow-natives-syntax --trace-turbo --trace-turbo-path turbo_out --trace-turbo-filter test

<p>What is the difference between using <code>'%OptimizeFunctionOnNextCall()'</code> alone and using <code>'%OptimizeFunctionOnNextCall()'</code> accompanied with <code>'%PrepareFunctionForOptimization()</code>'?</p>
<pre><code>function test() {
// some code here to optimize
}

%OptimizeFunctionOnNextCall(test);
test();

// ./d8 test.js --allow-natives-syntax --trace-turbo --trace-turbo-path turbo_out --trace-turbo-filter test
</code></pre>
<pre><code>function test() {
// some code here to optimize
}

%PrepareFunctionForOptimization(test);
test();
%OptimizeFunctionOnNextCall(test);
test();

// ./d8 test.js --allow-natives-syntax --trace-turbo --trace-turbo-path turbo_out --trace-turbo-filter test
</code></pre>
 

Latest posts

Top