Skip to content

Conversation

lrq3000
Copy link
Member

@lrq3000 lrq3000 commented Dec 29, 2015

This PR provides dynamic bytecode opcodes analysis in tests_perf.py, to compare the number of opcodes required to run tqdm vs a native range().

The idea is to run tqdm and dynamically analyze the number of bytecode opcodes executed at runtime for a standard run. This would provide a way to discretize and virtualize the time taken to run tqdm compared to native range.

The problem is that it works only on Python 2.x because the required library bytecode_tracer requires implib, but implib was removed from Python 3.x and replaced by importlib, but the API is quite different. On the other hand, importlib wasn't backported to Python 2.x. We should thus rewrite code_rewriting_importer.py to use implib on Py2 and importlib on Py3, I don't think it should be a lot of work for someone with experience in making custom importers, but I don't have this experience so I cannot do much more.

TODO:

  • Fix bytecode_tracer Py3 compatibility (ie, need to use importlib instead of implib in code_rewriting_importer.py).
  • Fix nosetests trying to test bytecode_tracer module.

Signed-off-by: Stephen L. <lrq3000@gmail.com>
@codecov-io
Copy link

Current coverage is 100.00%

Merging #90 into master will not affect coverage as of 8bcdc5e

@@            master     #90   diff @@
======================================
  Files            5       5       
  Stmts          239     239       
  Branches        49      49       
  Methods          0       0       
======================================
  Hit            239     239       
  Partial          0       0       
  Missed           0       0       

Review entire Coverage Diff as of 8bcdc5e

Powered by Codecov. Updated on successful CI builds.

@lrq3000 lrq3000 added the help wanted 🙏 We need you (discussion or implementation) label Dec 29, 2015
@lrq3000
Copy link
Member Author

lrq3000 commented Jan 16, 2016

Another library that can maybe be used instead: glassbox.

@lrq3000
Copy link
Member Author

lrq3000 commented May 15, 2016

A new library: py.code

@lrq3000 lrq3000 changed the title Add bytecode opcode test perf Add performance test via bytecode opcode analysis May 27, 2016
@lrq3000 lrq3000 added the p4-enhancement-future 🧨 On the back burner label Aug 28, 2016
@casperdcl casperdcl force-pushed the master branch 4 times, most recently from 8cade97 to a65e347 Compare October 31, 2016 02:34
@casperdcl casperdcl force-pushed the master branch 6 times, most recently from 6ec00f1 to 4b6476a Compare July 22, 2017 14:15
@lrq3000 lrq3000 requested a review from casperdcl as a code owner August 2, 2020 14:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted 🙏 We need you (discussion or implementation) p4-enhancement-future 🧨 On the back burner
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants