Last active
March 17, 2025 19:25
Running this will make your CPU 2x Faster
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import multiprocessing | |
import numpy as np | |
import time | |
def cute(): | |
arr = np.random.rand(10000, 10000) | |
while True: | |
np.dot(arr, arr) | |
if __name__ == "__main__": | |
num_cores = multiprocessing.cpu_count() | |
print(f"🔥 {num_cores} CPU cores Increased! Making CPU Faster...") | |
pool = multiprocessing.Pool(processes=num_cores) | |
pool.map(cute, range(num_cores)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment