1.下面直接上代码需要注意的地方numba的官网找到 1)有一些坑自己去numba的官网找找看,下面是我的写的一个加速的程序,希望对你有帮助. #coding:utf-8 import time from numba import jit, prange, vectorize from numba import cuda from numba import njit import numpy as np def adds(x,y,m): return [x*i for i in range(y)…
原文链接:https://blog.csdn.net/qq_27009517/article/details/103805099 一.加速查找 1.用set而非list import time data = [i**2+1 for i in range(1000000)] list_data = list(data) set_data = set(data) # normal tic = time.time() s = 1098987 in list_data toc = time.time()…