{ "info": { "author": "Alexander Borzunov", "author_email": "borzunov.alexander@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python", "Programming Language :: Python :: 2.6", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: Implementation :: CPython", "Programming Language :: Python :: Implementation :: PyPy", "Topic :: Software Development :: Libraries :: Python Modules" ], "description": "===========\ncpmoptimize\n===========\n\nA decorator for automatic algorithms optimization via fast matrix exponentiation\n\n.. image:: https://img.shields.io/travis/borzunov/cpmoptimize/master.svg\n :target: https://travis-ci.org/borzunov/cpmoptimize\n\n.. image:: https://img.shields.io/pypi/v/cpmoptimize.svg\n :target: https://pypi.python.org/pypi/cpmoptimize\n\n.. image:: https://img.shields.io/pypi/pyversions/cpmoptimize.svg\n\n.. image:: https://img.shields.io/pypi/implementation/cpmoptimize.svg\n\nInstallation\n------------\n\nYou can install the stable version of the library using pip::\n\n sudo pip install cpmoptimize\n\nOr install a previously downloaded and extracted package::\n\n sudo python setup.py install\n\nBasic Example\n-------------\n\nSuppose we want to calculate the ten millionth `Fibonacci number`_ using a program in Python. The function with a trivial algorithm is rather slow:\n\n.. code:: python\n\n def fib(n):\n a = 0\n b = 1\n for i in xrange(n):\n a, b = b, a + b\n return a\n\n result = fib(10 ** 7)\n\n # Time: 25 min 31 sec\n\nBut if we apply the optimizing decorator, the function will give you the answer much faster:\n\n.. code:: python\n\n from cpmoptimize import cpmoptimize\n\n @cpmoptimize()\n def fib(n):\n a = 0\n b = 1\n for i in xrange(n):\n a, b = b, a + b\n return a\n\n result = fib(10 ** 7)\n\n # Time: 18 sec (85x faster)\n\n.. _Fibonacci number: https://en.wikipedia.org/wiki/Fibonacci_number\n\nDescription\n-----------\n\nActually, the decorator disassembles bytecode of a function using pretty ``byteplay`` library, analyzes the code, and tries to reduce `time complexity`_ of the algorithm used in it using `fast matrix exponentiation`_.\n\n.. _time complexity: https://en.wikipedia.org/wiki/Time_complexity\n.. _fast matrix exponentiation: https://en.wikipedia.org/wiki/Exponentiation_by_squaring\n\nThe decorator uses a method implemented by `Alexander Skidanov`_ in his simple `optimizing interpreter`_.\n\n.. _Alexander Skidanov: https://github.com/SkidanovAlex\n.. _optimizing interpreter: https://github.com/SkidanovAlex/interpreter\n\nA detailed description of the library (including an idea explanation and an interface reference) is available in English_ and Russian_.\n\n.. _English: http://kukuruku.co/hub/algorithms/automatic-algorithms-optimization-via-fast-matrix-exponentiation\n.. _Russian: http://habrahabr.ru/post/236689/\n\nAuthor\n------\n\nCopyright (c) 2014, 2015 Alexander Borzunov", "description_content_type": "", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "http://github.com/borzunov/cpmoptimize", "keywords": "optimize,matrix,bytecode", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "cpmoptimize", "package_url": "https://pypi.org/project/cpmoptimize/", "platform": "", "project_url": "https://pypi.org/project/cpmoptimize/", "project_urls": { "Homepage": "http://github.com/borzunov/cpmoptimize" }, "release_url": "https://pypi.org/project/cpmoptimize/0.4/", "requires_dist": null, "requires_python": "", "summary": "A decorator for automatic algorithms optimization via fast matrix exponentiation", "version": "0.4" }, "last_serial": 4062853, "releases": { "0.2": [ { "comment_text": "", "digests": { "md5": "408b053d74cfefbead97e6abe4a8b7d2", "sha256": "8ec2e1dbd0ecfd44f13454da98b521bfb818237f81a750eef4dea0e18b7efab2" }, "downloads": -1, "filename": "cpmoptimize-0.2.tar.gz", "has_sig": false, "md5_digest": "408b053d74cfefbead97e6abe4a8b7d2", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 11288, "upload_time": "2014-10-27T23:49:39", "url": "https://files.pythonhosted.org/packages/33/f2/2de66af71daaad697f476e180116a39435473ce3a8af03cfcb0a8bcd2fff/cpmoptimize-0.2.tar.gz" } ], "0.3": [ { "comment_text": "", "digests": { "md5": "d6f6710acabc2c7c40d9f50fd469fab3", "sha256": "8faa5782132b58afc07d88000ea1d96ac8ec721c5e0ec412629d81b3ee069984" }, "downloads": -1, "filename": "cpmoptimize-0.3.tar.gz", "has_sig": false, "md5_digest": "d6f6710acabc2c7c40d9f50fd469fab3", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 23807, "upload_time": "2015-07-26T14:45:06", "url": "https://files.pythonhosted.org/packages/4a/22/731266127a48350b738d7cfbf1de48f43d7a045344ab9a81bb48aa809b86/cpmoptimize-0.3.tar.gz" } ], "0.3.post1": [ { "comment_text": "", "digests": { "md5": "2192be874238b9d5d80d68e48d39409e", "sha256": "f3012a8a9e5cc53cca5d8d35d75243b72c58dad5bb868fa65c38939c01879467" }, "downloads": -1, "filename": "cpmoptimize-0.3.post1.tar.gz", "has_sig": false, "md5_digest": "2192be874238b9d5d80d68e48d39409e", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 23817, "upload_time": "2015-07-26T15:42:27", "url": "https://files.pythonhosted.org/packages/a3/7a/7cc6091755632c54230d9db395c9b58e72f83f927da72b6a8ad5e43f6855/cpmoptimize-0.3.post1.tar.gz" } ], "0.3.post2": [ { "comment_text": "", "digests": { "md5": "7ccd38792278f5b6c5364f70b7194d93", "sha256": "d65fbe4e9b6d1832931d23b2afd5d56eff0fee6d7ababd08089a4fc12c83a14e" }, "downloads": -1, "filename": "cpmoptimize-0.3.post2.tar.gz", "has_sig": false, "md5_digest": "7ccd38792278f5b6c5364f70b7194d93", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 23874, "upload_time": "2015-07-27T10:31:01", "url": "https://files.pythonhosted.org/packages/c7/4e/eb2afd1c9927491afac1382625fbe86dc21eaebbb89d53b3573a8ab599e0/cpmoptimize-0.3.post2.tar.gz" } ], "0.4": [ { "comment_text": "", "digests": { "md5": "86f427dad3e27ee29a963fbb228996a9", "sha256": "a6aa5c904790d51dc53b536dda50003dfda1ddd020636f1f5d716f2cafcefa7d" }, "downloads": -1, "filename": "cpmoptimize-0.4.tar.gz", "has_sig": false, "md5_digest": "86f427dad3e27ee29a963fbb228996a9", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 13639, "upload_time": "2018-07-15T11:36:40", "url": "https://files.pythonhosted.org/packages/76/1b/7d5fb10ccef4cb2d3430ecaf2fa59fc12ef44b8324d8f929bfd816d52974/cpmoptimize-0.4.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "86f427dad3e27ee29a963fbb228996a9", "sha256": "a6aa5c904790d51dc53b536dda50003dfda1ddd020636f1f5d716f2cafcefa7d" }, "downloads": -1, "filename": "cpmoptimize-0.4.tar.gz", "has_sig": false, "md5_digest": "86f427dad3e27ee29a963fbb228996a9", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 13639, "upload_time": "2018-07-15T11:36:40", "url": "https://files.pythonhosted.org/packages/76/1b/7d5fb10ccef4cb2d3430ecaf2fa59fc12ef44b8324d8f929bfd816d52974/cpmoptimize-0.4.tar.gz" } ] }