I recently got a new laptop, with a better CPU processor (from i5 to i7), NVIDIA graphics card and more RAM. However, my Numba @njit(parallel=True) is running slower.
Is it likely that this could be due to the new laptop having Windows 11 installed?
When I bring up Numba system information, it says that it is installed on a Windows 10 machine:
__OS Information__
Platform Name : Windows-10-10.0.22621-SP0
Platform Release : 10
OS Name : Windows
OS Version : 10.0.22621
OS Specific Version : 10 10.0.22621 SP0 Multiprocessor Free
Libc Version : ?
Example code:
from datetime import datetime
from numba import cuda, njit
import numpy as np
@njit(parallel=True)
def rms(y):
“”" calculates the root mean square of an array
“”"
rms = np.sqrt(np.mean(y**2))
return rms
x = np.random.rand(100000000)
start = datetime.now()
result = rms(x)
print(‘with @njit:’, datetime.now()-start)
def rms(y):
“”" calculates the root mean square of an array
“”"
rms = np.sqrt(np.mean(y**2))
return rms
start = datetime.now()
result = rms(x)
print(‘without @njit:’, datetime.now()-start)
with @njit: 0:00:01.297192
without @njit: 0:00:00.215754