Skip to content

Instantly share code, notes, and snippets.

@zeusdeux
Created October 6, 2025 23:36
Show Gist options
  • Save zeusdeux/f1143bf13acdc02e2ed9bdcf6436da5b to your computer and use it in GitHub Desktop.
Save zeusdeux/f1143bf13acdc02e2ed9bdcf6436da5b to your computer and use it in GitHub Desktop.
Using node intrinsics to force optimizations
// node --allow-natives-syntax --print-opt-code --trace-deopt force-opt.js
function test(x) { return 1 + Math.sin(x) }
%PrepareFunctionForOptimization(test);
test(0.5); test(0.6);
%OptimizeFunctionOnNextCall(test);
test(0.7);
%FinalizeOptimization();
%GetOptimizationStatus(test);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment