Skip to content

Commit

Permalink
Create test_speed.py
Browse files Browse the repository at this point in the history
New test for speed
  • Loading branch information
sergey-dryabzhinsky authored Jan 19, 2025
1 parent f2d814d commit 509acd1
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions tests/test_speed.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Tests

from tests.base import BaseTestZSTD,tDATA,log,zstd
import time

class TestZstdSpeed(BaseTestZSTD):

def test_system_info(self):
log.info("Bundled libzstd uses assembler? :")
log.info("Bundled libzstd uses threads? :")
(self)

def test_compressio_speed(self):
log.info("Compression speed average = b/sec")
sec = 60
sum = 0
l=len(tDATA)
tbegin = time.time()
while time.time()-tbegin!=sec:
cdata = zstd.compress(tDATA)
sum+=l

log.info("Compression speed average =%.%f b/sec" % (1.0*sum/sec))

if __name__ == '__main__':
unittest.main()

0 comments on commit 509acd1

Please sign in to comment.