-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Add performance test via bytecode opcode analysis #90
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
lrq3000
wants to merge
1
commit into
master
Choose a base branch
from
bytecode-perf
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Signed-off-by: Stephen L. <lrq3000@gmail.com>
Current coverage is
|
Another library that can maybe be used instead: glassbox. |
A new library: py.code |
8cade97
to
a65e347
Compare
6ec00f1
to
4b6476a
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR provides dynamic bytecode opcodes analysis in
tests_perf.py
, to compare the number of opcodes required to runtqdm
vs a nativerange()
.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 runtqdm
compared to nativerange
.The problem is that it works only on Python 2.x because the required library bytecode_tracer requires
implib
, butimplib
was removed from Python 3.x and replaced byimportlib
, but the API is quite different. On the other hand,importlib
wasn't backported to Python 2.x. We should thus rewritecode_rewriting_importer.py
to useimplib
on Py2 andimportlib
on Py3, I don't think it should be a lot of work for someone with experience in makingcustom importers
, but I don't have this experience so I cannot do much more.TODO:
importlib
instead ofimplib
incode_rewriting_importer.py
).bytecode_tracer
module.