Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
afae11ea
Commit
afae11ea
authored
Jul 05, 2008
by
Raymond Hettinger
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update comment on prediction macros.
parent
66ef83bd
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
11 deletions
+13
-11
Python/ceval.c
Python/ceval.c
+13
-11
No files found.
Python/ceval.c
View file @
afae11ea
...
...
@@ -615,18 +615,20 @@ PyEval_EvalFrameEx(PyFrameObject *f, int throwflag)
COMPARE_OP is often followed by JUMP_IF_FALSE or JUMP_IF_TRUE. And,
those opcodes are often followed by a POP_TOP.
Verifying the prediction costs a single high-speed test of register
Verifying the prediction costs a single high-speed test of
a
register
variable against a constant. If the pairing was good, then the
processor has a high likelihood of making its own successful branch
prediction which results in a nearly zero overhead transition to the
next opcode.
A successful prediction saves a trip through the eval-loop including
its two unpredictable branches, the HAS_ARG test and the switch-case.
If collecting opcode statistics, turn off prediction so that
statistics are accurately maintained (the predictions bypass
the opcode frequency counter updates).
processor's own internal branch predication has a high likelihood of
success, resulting in a nearly zero-overhead transition to the
next opcode. A successful prediction saves a trip through the eval-loop
including its two unpredictable branches, the HAS_ARG test and the
switch-case. Combined with the processor's internal branch prediction,
a successful PREDICT has the effect of making the two opcodes run as if
they were a single new opcode with the bodies combined.
If collecting opcode statistics, your choices are to either keep the
predictions turned-on and interpret the results as if some opcodes
had been combined or turn-off predictions so that the opcode frequency
counter updates for both opcodes.
*/
#ifdef DYNAMIC_EXECUTION_PROFILE
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment