From d85e447ce1bddde2b3bc4886dc8f907fee179346 Mon Sep 17 00:00:00 2001 From: Casper da Costa-Luis Date: Sun, 30 Oct 2016 16:15:30 +0000 Subject: [PATCH] initial benchmark framework to visualise regression --- .gitignore | 4 ++++ CONTRIBUTE | 26 ++++++++++++++++++++++++++ asv.conf.json | 28 ++++++++++++++++++++++++++++ benchmarks/__init__.py | 0 benchmarks/benchmarks.py | 25 +++++++++++++++++++++++++ 5 files changed, 83 insertions(+) create mode 100644 asv.conf.json create mode 100644 benchmarks/__init__.py create mode 100644 benchmarks/benchmarks.py diff --git a/.gitignore b/.gitignore index 7caab158..f9274e85 100644 --- a/.gitignore +++ b/.gitignore @@ -39,3 +39,7 @@ nosetests.xml # PyCharm .idea + +# asv +.asv/ +benchmarks/*.pyc diff --git a/CONTRIBUTE b/CONTRIBUTE index 5973a197..8f942cb7 100644 --- a/CONTRIBUTE +++ b/CONTRIBUTE @@ -249,6 +249,32 @@ cannot re-upload another with the same version number updating just the metadata is possible: `[python setup.py] make pypimeta` +UPDATING GH-PAGES +----------------- + +The most important file is README.rst, which sould always be kept up-to-date +and in sync with the in-line source documentation. This will affect all of the +following: + +- The [main repository site](https://github.com/tqdm/tqdm) which automatically + serves the latest README.rst as well as links to all of github's features. + This is the preferred online referral link for tqdm. +- The [PyPi mirror](https://pypi.python.org/pypi/tqdm) which automatically + serves the latest release built from README.rst as well as links to past + releases. +- Many external web crawlers. + + +Additionally (less maintained), there exists: + +- A [wiki](https://github.com/tqdm/tqdm/wiki) which is publicly editable. +- The [gh-pages project](https://tqdm.github.io/tqdm/) which is built from the + [gh-pages branch](https://github.com/tqdm/tqdm/tree/gh-pages), which is + built using [asv](https://github.com/spacetelescope/asv/). +- The [gh-pages root](https://tqdm.github.io/) which is built from a separate + outdated [github.io repo](https://github.com/tqdm/tqdm.github.io). + + QUICK DEV SUMMARY ----------------- diff --git a/asv.conf.json b/asv.conf.json new file mode 100644 index 00000000..bfb888c7 --- /dev/null +++ b/asv.conf.json @@ -0,0 +1,28 @@ +{ + "version": 1, + "project": "tqdm", + "project_url": "https://github.com/tqdm/tqdm/", + "repo": ".", + "environment_type": "virtualenv", + "show_commit_url": "http://github.com/tqdm/tqdm/commit/", + // "pythons": ["2.7", "3.3"], + // "matrix": { + // "numpy": ["1.6", "1.7"], + // "six": ["", null], // test with and without six installed + // "pip+emcee": [""], // emcee is only available for install with pip. + // }, + // "exclude": [ + // {"python": "3.2", "sys_platform": "win32"}, // skip py3.2 on windows + // {"environment_type": "conda", "six": null}, // don't run without six on conda + // ], + // "include": [ + // // additional env for python2.7 + // {"python": "2.7", "numpy": "1.8"}, + // // additional env if run on windows+conda + // {"platform": "win32", "environment_type": "conda", "python": "2.7", "libpython": ""}, + // ], + "benchmark_dir": "benchmarks", + "env_dir": ".asv/env", + "results_dir": ".asv/results", + "html_dir": ".asv/html", +} diff --git a/benchmarks/__init__.py b/benchmarks/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/benchmarks/benchmarks.py b/benchmarks/benchmarks.py new file mode 100644 index 00000000..3f709d2b --- /dev/null +++ b/benchmarks/benchmarks.py @@ -0,0 +1,25 @@ +# Write the benchmarking functions here. +# See "Writing benchmarks" in the asv docs for more information. + + +class TimeSuite: + """ + An example benchmark that times the performance of various kinds + of iterating over dictionaries in Python. + """ + def setup(self): + from tqdm import tqdm + self.tqdm = tqdm + try: + self.iterable = xrange(int(6e6)) + except: + self.iterable = range(int(6e6)) + + def time_tqdm(self): + [0 for _ in self.tqdm(self.iterable)] + + +class MemSuite: + # def mem_list(self): + # return [0] * 256 + pass