Commit c721668c authored by Tomas Krizek's avatar Tomas Krizek

dbhelper: remove unsafe fast option

This unsafe option no longer provides any performance benefits.
parent 8cb87514
......@@ -31,8 +31,7 @@ class LMDB:
# integerkey support in LMDB
} # type: Dict[str, Any]
def __init__(self, path: str, create: bool = False,
readonly: bool = False, fast: bool = False) -> None:
def __init__(self, path: str, create: bool = False, readonly: bool = False) -> None:
self.path = path
self.dbs = {} # type: Dict[bytes, Any]
self.config = LMDB.ENV_DEFAULTS.copy()
......@@ -41,12 +40,6 @@ class LMDB:
'create': create,
'readonly': readonly
})
if fast: # unsafe on crashes, but faster
self.config.update({
'writemap': True,
'sync': False,
'map_async': True,
})
if not os.path.exists(self.path):
os.makedirs(self.path)
......
......@@ -238,7 +238,7 @@ def main():
criteria = config['diff']['criteria']
target = config['diff']['target']
with LMDB(args.envdir, fast=True) as lmdb_:
with LMDB(args.envdir) as lmdb_:
lmdb = lmdb_
lmdb.open_db(LMDB.ANSWERS)
lmdb.open_db(LMDB.DIFFS, create=True, drop=True)
......
......@@ -76,7 +76,7 @@ def main():
'end_time': None,
}
with LMDB(args.envdir, fast=True) as lmdb:
with LMDB(args.envdir) as lmdb:
lmdb.open_db(LMDB.QUERIES)
adb = lmdb.open_db(LMDB.ANSWERS, create=True, check_notexists=True)
sdb = lmdb.open_db(LMDB.STATS, create=True)
......
......@@ -131,7 +131,7 @@ def main():
logging.critical("Missing path to pcap file, use argument --pcap-file")
sys.exit(1)
with LMDB(args.envdir, fast=True) as lmdb:
with LMDB(args.envdir) as lmdb:
qdb = lmdb.open_db(LMDB.QUERIES, create=True, check_notexists=True)
with lmdb.env.begin(qdb, write=True) as txn:
with pool.Pool() as workers:
......
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