有GPU 平台
测试通用代码
import time
import paddle
import pandas as pd
# 测试paddle.load
start_time = time.time()
paddle_data = paddle.load('long_attention_model')
end_time = time.time()
print(f"Paddle load time: {end_time - start_time} seconds")
# 测试pandas.read_pickle
start_time = time.time()
pandas_data = pd.read_pickle('long_attention_model')
end_time = time.time()
print(f"Pandas read_pickle time: {end_time - start_time} seconds")
无GPU 平台
总结
paddle无论是在任何平台速度比pandas慢很多,分析可知这个属于IO操作,GPU并不参与。