user
Task

The task description is taken from Project Euler (https://projecteuler.net/problem=10)
  
The sum of the primes below 10 is 2 + 3 + 5 + 7 = 17
  
Find the sum of all the primes below **two million**
assistant
Slow, but only using compiler built-ins (about 5 seconds)

```
say sum (^2e6).grep: {.&is-prime};

```

Output:

```
142913828922
```

Much faster using external libraries (well under half a second)

```
use Math::Primesieve;
my $sieve = Math::Primesieve.new;
say sum $sieve.primes(2e6.Int);

```

Same output