I want to load pickle file of size 4.23GB. I use below code to load the data:
import _pickle as cPickle
def read_pickle(file):
try:
with open(file, "rb") as input_file:
data = cPickle.load(input_file)
return data
except Exception as e:
print("Error in reading data from pickle file",e)
SyStem Configuration: 16Cores 32GB RAM
Output:
%time data=read_pickle(file)
CPU times: user 5.79 s, sys: 1.21 s, total: 7 s
Wall time: 7 s
As multiple user are using this in code so I want to load this file once in my code and use its return data each and every time is there anyway to map this file to disk to avoid load file every time or reduce loading time.