add benchmark results

This commit is contained in:
PyYoshi 2017-03-28 10:29:19 +09:00
parent fb8a7a2719
commit 00ff3c9bb8

View file

@ -212,11 +212,53 @@ Example
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
import cchardet as chardet import cchardet as chardet
with open(r"src/tests/testdata/wikipediaJa_One_Thousand_and_One_Nights_SJIS.txt", "rb") as f: with open(r"src/tests/samples/wikipediaJa_One_Thousand_and_One_Nights_SJIS.txt", "rb") as f:
msg = f.read() msg = f.read()
result = chardet.detect(msg) result = chardet.detect(msg)
print(result) print(result)
Benchmark
---------
.. code-block:: bash
$ cd src/
$ pip install chardet
$ python tests/bench.py
Results
~~~~~~~
CPU: Intel(R) Core(TM) i5-4690 CPU @ 3.50GHz
RAM: DDR3 1600Mhz 16GB
Platform: Ubuntu 16.04 amd64
Python 2.7.12
^^^^^^^^^^^^^
+----------+------------------+
| | Request (call/s) |
+==========+==================+
| chardet | 0.26 |
+----------+------------------+
| cchardet | 1341.81 |
+----------+------------------+
Python 3.6.0
^^^^^^^^^^^^
+----------+------------------+
| | Request (call/s) |
+==========+==================+
| chardet | 0.26 |
+----------+------------------+
| cchardet | 1472.43 |
+----------+------------------+
LICENSE LICENSE
------- -------