-
Notifications
You must be signed in to change notification settings - Fork 3.8k
Open
Labels
bugSomething isn't workingSomething isn't workingjscRelated to an issue in JavaScriptCoreRelated to an issue in JavaScriptCoreperformanceAn issue with performanceAn issue with performance
Description
What version of Bun is running?
1.2.23, 1.3
What platform is your computer?
Darwin 23.3.0 arm64 arm
What steps can reproduce the bug?
Run this code in Bun, and a runtime like Deno / Node
// Program counting fib(n)
let prev = BigInt(0);
let curr = BigInt(1);
let n = Number(process.argv.length > 2 ? process.argv[2] : null);
if(isNaN(n)) { console.log("Provide a valid number"); process.exit(0); }
let start = Date.now();
for(let i = 0; i < n; ++i){
let tmp = prev + curr;
prev = curr;
curr = tmp;
}
let end = Date.now();
console.log(end - start);Bun consistently takes ~2x as much time (Tested for n=100k, n=1mil)
What is the expected behavior?
At least the same performance as other runtimes
What do you see instead?
Slow performance
Additional information
There was an almost identical issue reported a few years ago, I was told to make a new issue because Bun has changed a lot since then
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't workingjscRelated to an issue in JavaScriptCoreRelated to an issue in JavaScriptCoreperformanceAn issue with performanceAn issue with performance