Fastest
Code 1
5.62 ms
178 op/s
Speed
Benchmark | Runtime | Operations | VS | Visual |
---|---|---|---|---|
Code 1 | 5.62 ms | 178 op/s | 1× | |
Code 2 | 545 ms | 1.83 op/s | 97× |
Memory
Benchmark | Peak Memory | Score | VS | Visual |
---|---|---|---|---|
Code 1 | 24.0 MB | 5.87 | 1× | |
Code 2 | 80.0 MB | 3.36 | 3.3× |
Output
Code 1
Using NumPy took: 0.029782533645629883 seconds
Code 2
Using loop took: 0.5657362937927246 seconds