Skip to content

Commit 1755393

Browse files
chore: use milliseconds unit in output
1 parent 2779c5d commit 1755393

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

perf.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,25 +28,24 @@ def test_pkl(data):
2828
dat[label]
2929
t = time.perf_counter() - s
3030

31-
pf.write(f"{datasize}\t{t*1000:.5f}\n")
31+
pf.write(f"{datasize}\t{t*1000:.1f} ms\n")
3232
pf.flush()
3333

34-
3534
def test_mb(data):
3635
datasize = len(data)
3736
labels = list(data.keys())
3837
random.shuffle(labels)
3938
labels = labels[:datasize//10]
4039

41-
mbuf = MapBuffer(data)
40+
mbuf = MapBuffer(data, compute_crc=False)
4241
buf = mbuf.tobytes()
4342

4443
s = time.perf_counter()
4544
mbuf = MapBuffer(buf)
4645
for label in labels:
4746
mbuf[label]
4847
t = time.perf_counter() - s
49-
mf.write(f"{datasize}\t{t*1000:.5f}\n")
48+
mf.write(f"{datasize}\t{t*1000:.1f} ms\n")
5049
mf.flush()
5150

5251
sz = 1

0 commit comments

Comments
 (0)