You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Comment/uncomment line with setInterval. Same for setTimeout:
const waitTick = () => new Promise(setImmediate);
const runJob = async () => {
const st = performance.now();
await waitTick();
const et = performance.now() - st;
console.log(`${et.toFixed(3)}ms`);
};
const st = performance.now();
// setInterval(() => {}, 1000); // uncomment to see the issue
// setTimeout(() => {}, 1000); // uncomment to see the issue for X ms. After X ms the issue is gone
for (let i = 0; i < 1e3; i++) {
await runJob();
}
const et = performance.now() - st;
console.log(`finished in ${et.toFixed(3)}ms`);
export {};
What version of Bun is running?
1.2.4+fd9a5ea66
Also 1.1.25
What platform is your computer?
Darwin 23.6.0 arm64 arm
What steps can reproduce the bug?
Comment/uncomment line with
setInterval
. Same forsetTimeout
:What is the expected behavior?
The script should be executed in a few ms.
Expected result:
What do you see instead?
The script is being executed for a long period of time.
Actual result:
~1700 times slower!
Additional information
I've checked Inspector and seems like the problem inside
Partial GC
call:NodeJS 20.10 result:
The text was updated successfully, but these errors were encountered: