Earliest difference between prime gaps: Difference between revisions

→‎{{header|Wren}}: Added timing as it's a lot less than Pete's figure.
m (→‎{{header|Phix}}: only needs a multiplier of 4)
(→‎{{header|Wren}}: Added timing as it's a lot less than Pete's figure.)
Line 277:
{{libheader|Wren-fmt}}
Unfortunately, my machine doesn't have enough memory to look for the earliest difference > 1 billion.
 
This takes 23 seconds to run on my machine (core i7, 32GB RAM, Ubuntu 20.04) which is what I'd expect as Wren is typically 4 or 5 times slower than Phix.
 
If anyone's wondering why I can't sieve 5 billion numbers with this much RAM, the reason is that bools require 8 bytes of storage in Wren (all value types do) compared to only 1 byte in most statically typed languages (or even 1 bit if they support bitarrays).
<lang ecmascript>import "./math" for Int
import "/fmt" for Fmt
9,485

edits