Commit 2e85e664 authored by Alvin Noe Ladines's avatar Alvin Noe Ladines
Browse files

Fixed performance issue with writing msgpack files

parent 09ba5074
Pipeline #68233 passed with stages
in 14 minutes and 34 seconds
......@@ -286,10 +286,12 @@ class ArchiveFileDB:
data_to_write[-1].append(sep)
data_to_write[-1].append(self.max_lfragment)
# add pointers to entries
start_index = 0
for i in range(len(entries)):
sep = '%s_%d' % (self._sep, i + last_index)
index = data_str.index(sep.encode()) + len(sep)
index = data_str.index(sep.encode(), start_index) + len(sep)
head[entries[i]['path']] = index
start_index = index
sep = '%s_IDS' % (self._sep)
data_to_write[-1].append(sep)
data_to_write[-1].append(head)
......
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