update benchmark
This commit is contained in:
parent
bb4df62c77
commit
75774f628a
1 changed files with 24 additions and 21 deletions
|
@ -1,14 +1,14 @@
|
|||
#!/usr/bin/env python
|
||||
# coding: utf-8
|
||||
|
||||
import time
|
||||
|
||||
import cchardet
|
||||
import chardet
|
||||
|
||||
|
||||
class TestCchardetSpeed():
|
||||
def test_speed(self):
|
||||
import time
|
||||
do_times = 5
|
||||
def main():
|
||||
do_times = 100
|
||||
path = r'tests/testdata/wikipediaJa_One_Thousand_and_One_Nights_SJIS.txt'
|
||||
with open(path, 'rb') as f:
|
||||
msg = f.read()
|
||||
|
@ -28,3 +28,6 @@ class TestCchardetSpeed():
|
|||
cchardet.detect(msg)
|
||||
result_cchardet += (time.time() - start_cchardet)
|
||||
print('cchardet:', 1 / (result_cchardet / do_times), 'call(s)/s')
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
|
|
Loading…
Reference in a new issue