-
Notifications
You must be signed in to change notification settings - Fork 26
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
Faster tracing test #6
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay, I think I understand this now, and while it makes me uneasy, I also understand the point, so I guess I support it. But a few things gave me pause...
Python/ceval.c
Outdated
#define TARGET(op) \ | ||
op: \ | ||
TARGET_##op |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe make this macro a one-liner too? It would seem to fit. :-)
Python/ceval.c
Outdated
#else | ||
#define TARGET(op) op | ||
#define DISPATCH_GOTO goto dispatch_opcode; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For stylistic reasons (consistency with e.g. DISPATCH()
) I'd prefer making this a function macro, and moving the semicolon to after the "call". Seeing DISPATCH_GOTO
(line 1317) without a semicolon makes my mind do a double-take each time I see it.
CFrame *prev_cframe = tstate->cframe; | ||
trace_info.cframe.use_tracing = prev_cframe->use_tracing; | ||
trace_info.cframe.previous = prev_cframe; | ||
tstate->cframe = &trace_info.cframe; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hm, this is disturbing -- tstate (which is pretty much a global structure) now has a pointer to a local variable. That means you have to restore this on every exit from the function. Now, we know there's only one exit, and it's handled there, but it still makes me feel weird. And all this to make it possible to set a single int (perhaps even a single bit) from "outside" this function.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I know, and it would seem like overkill, if it weren't for how critical reads of that single int are.
That one int gets read 100 million times per second, and the code to read it occurs over 100 times in the interpreter.
I've made the relevant changes to python#25244 |
f9fdb65
to
7262620
Compare
7262620
to
2cf3c98
Compare
For review only