You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Added multi-threading performance tests which show that, during compression and decompression, it is not a tiny bit faster than without, which is due to the GIL and even separately locked zlib module implementations. The only way to make this faster update the resepctive c modules to drop the gil, and their own locks where possible
print>>sys.stderr, "Read %i KiB of %s data in %i KiB chunks from loose odb in %f s ( %f Read KiB / s)"% (size_kib, desc, cs_kib, elapsed_readchunks, size_kib/elapsed_readchunks)
80
115
81
-
# del db file so git has something to do
116
+
# del db file so we keep something to do
82
117
os.remove(db_file)
83
-
84
118
# END for each randomization factor
119
+
120
+
121
+
# multi-threaded mode
122
+
# want two, should be supported by most of todays cpus
# write multiple objects at once, involving concurrent compression
139
+
reader=IteratorReader(istream_iter())
140
+
istream_reader=ldb.store_async(reader)
141
+
istream_reader.task().max_chunksize=1
142
+
143
+
st=time()
144
+
istreams=istream_reader.read(nsios)
145
+
assertlen(istreams) ==nsios
146
+
elapsed=time() -st
147
+
148
+
print>>sys.stderr, "Threads(%i): Compressed %i KiB of data in loose odb in %f s ( %f Write KiB / s)"% (pool.size(), total_kib, elapsed, total_kib/elapsed)
print>>sys.stderr, "Threads(%i): Decompressed %i KiB of data in loose odb in %f s ( %f Write KiB / s)"% (pool.size(), total_kib, elapsed, total_kib/elapsed)
163
+
164
+
# store the files, and read them back. For the reading, we use a task
165
+
# as well which is chunked into one item per task. Reading all will
166
+
# very quickly result in two threads handling two bytestreams of
print>>sys.stderr, "Threads(%i): Compressed and decompressed and read %i KiB of data in loose odb in %f s ( %f Combined KiB / s)"% (pool.size(), total_kib, elapsed, total_kib/elapsed)
0 commit comments