Fastest
OpenCV
139 us
7.17K op/s
Speed
Benchmark | Runtime | Operations | VS | Visual |
---|---|---|---|---|
OpenCV | 139 us | 7.17K op/s | 1× | |
numpy.where - uint8 | 6.05 ms | 165 op/s | 43× | |
numpy.where | 7.66 ms | 131 op/s | 55× | |
Numpy indexing | 9.80 ms | 102 op/s | 70× |
Memory
Benchmark | Peak Memory | Score | VS | Visual |
---|---|---|---|---|
Numpy indexing | 1.11 MB | 6.96 | 1× | |
OpenCV | 1.55 MB | 8.67 | 1.4× | |
numpy.where - uint8 | 2.17 MB | 6.88 | 1.95× | |
numpy.where | 9.36 MB | 6.14 | 8× |
Output
Numpy indexing
127.4941635131836
OpenCV
124.86409664154053
numpy.where
125.00295639038086
numpy.where - uint8
124.92027282714844