Potential Performance Issue with Large Numbers in Bun Compared to Node.js and Deno #14914
Matprogamerheus
started this conversation in
General
Replies: 1 comment
-
I was wondering about that too the other day while playing around with bigints. bun --print "999n**12345n" # works
bun --print "999n**123456n" # RangeError (immediately)
node --print "999n**12345678n" # works
node --print "999n**123456789n" # RangeError (after a while)
node --print "999n**1234567890n" # RangeError (immediately) Not sure if it's dependent on the available system resources or if it's a fixed limit. But there's definitely a difference. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Title: Potential Performance Issue with Large Numbers in Bun Compared to Node.js and Deno
Body:
Hello everyone,
I recently encountered an issue while testing Bun's performance, particularly when handling large numbers. I noticed that Node.js and Deno are able to handle the same script without any issues, but Bun throws an error. Here’s the context:
I was running a Fibonacci sequence script, and while using Bun, I encountered the following error:
Here is the Fibonacci script I used:
With this code, Bun quickly hits a
RangeError: Out of memory
, while Node.js and Deno can handle it just fine. Could this be an issue with Bun's BigInt implementation, or is there a known limitation I should be aware of? Any insights would be greatly appreciated!Beta Was this translation helpful? Give feedback.
All reactions