Commit d6b9c082 authored by Dominik Luntzer's avatar Dominik Luntzer

Improved loading performance when using cached address spaces

Use cPickle (basically a C-implementation of the already used pickle
mechanism) and ensure that the highest protocol version is used to
improve the loading performance.
parent e46d352b
from threading import RLock
import logging
import pickle
from datetime import datetime
try:
import cPickle as pickle
except:
import pickle
from opcua import ua
from opcua.server.users import User
......@@ -353,7 +356,7 @@ class AddressSpace(object):
dump address space as binary to file
"""
with open(path, 'wb') as f:
pickle.dump(self._nodes, f)
pickle.dump(self._nodes, f, pickle.HIGHEST_PROTOCOL)
def load(self, path):
"""
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment