问题描述:

I have a view that uses jsonify that is much slower on an external server than on localhost. Why does it take so long running on :5000 externally?

data = pickle.load(open("file.pkl", "rb"))

@app.route('getData')

def returnData():

return jsonify(data)

The file.pkl is a locally stored CSV of 100,000 lines (9 MB). When run locally the json loads in Javascript in 3 seconds. When run externally it takes 20 seconds.

In Javascript:

var dataLoader = $.get('./getData').then(function (data){

newData = data;

});

相关阅读:
Top