Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/hhatto/slowfast
Two Python code compare using timeit module
https://github.com/hhatto/slowfast
Last synced: 29 days ago
JSON representation
Two Python code compare using timeit module
- Host: GitHub
- URL: https://github.com/hhatto/slowfast
- Owner: hhatto
- Created: 2014-10-20T12:38:19.000Z (about 10 years ago)
- Default Branch: master
- Last Pushed: 2018-11-12T10:51:21.000Z (about 6 years ago)
- Last Synced: 2024-10-14T11:09:03.462Z (2 months ago)
- Language: Python
- Homepage:
- Size: 3.91 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.rst
Awesome Lists containing this project
README
slowfast
========
Two Python code compare using timeit module.Installation
------------from pip::
$ pip install git+https://github.com/hhatto/slowfast.git
Usage
-----
via module.. code-block:: python
# rev.py
import slowfasttitle = "sorted reverse list"
one = "l = sorted(l);l.reverse()"
two = "l = sorted(l, reverse=True)"
setup = "l = [1, 2, 3, 5]"
slowfast.compare(one, two, setup, title=title)compare::
$ python rev.py
===== sorted reverse list =====
(slow) 0.063604[sec]
l = sorted(l, reverse=True)
(fast) 0.035824[sec]
l = sorted(l);l.reverse()
1.78 times faster
$LICENSE
-------
MIT