Skip to content

Latest commit

 

History

History
2248 lines (2085 loc) · 45.8 KB

bm-20250205-azure-x86_64-iritkatriel-binary_subscr_to_op-3.14.0a4+-c05e483-pystats-comprehensions-vs-base.md

File metadata and controls

2248 lines (2085 loc) · 45.8 KB

Execution counts

Execution counts for Tier 1 instructions.

The "miss ratio" column shows the percentage of times the instruction executed that it deoptimized. When this happens, the base unspecialized instruction is not counted.

Name Base Count Head Count Change
BINARY_OP 20 8,851,040 44,255,100.0%
LOAD_FAST 200,056,440 200,056,440 0.0%
FOR_ITER_LIST 138,126,960 138,126,960 0.0%
JUMP_BACKWARD_NO_JIT 118,467,300 118,467,300 0.0%
STORE_FAST_LOAD_FAST 108,633,780 108,633,780 0.0%
LOAD_ATTR_INSTANCE_VALUE 103,227,300 103,227,300 0.0%
LIST_APPEND 79,634,100 79,634,100 0.0%
LOAD_ATTR_METHOD_NO_DICT 53,577,240 53,577,240 0.0%
CALL_METHOD_DESCRIPTOR_FAST 53,084,160 53,084,160 0.0%
GET_ITER 40,309,260 40,309,260 0.0%
RESUME_CHECK 36,375,120 36,375,120 0.0%
STORE_FAST 32,448,540 32,448,540 0.0%
SWAP 31,951,680 31,951,680 0.0%
CALL_PY_EXACT_ARGS 29,983,200 29,983,200 0.0%
BINARY_SUBSCR_DICT 26,542,440
POP_JUMP_IF_TRUE 26,050,680 26,050,680 0.0%
POP_JUMP_IF_FALSE 24,084,540 24,084,540 0.0%
TO_BOOL_BOOL 23,593,020 23,593,020 0.0%
RETURN_VALUE 22,613,640 22,613,640 0.0%
POP_TOP 21,627,720 21,627,720 0.0%
LOAD_ATTR_METHOD_WITH_VALUES 21,135,480 21,135,480 0.0%
LOAD_FAST_LOAD_FAST 18,199,500 18,199,500 0.0%
LOAD_GLOBAL_BUILTIN 18,186,420 18,186,420 0.0%
MAP_ADD 17,694,720 17,694,720 0.0%
INTERPRETER_EXIT 14,745,780 14,745,780 0.0%
TO_BOOL_ALWAYS_TRUE 14,376,960 14,376,960 0.0%
YIELD_VALUE 14,254,440 14,254,440 0.0%
LOAD_GLOBAL_MODULE 12,289,980 12,289,980 0.0%
TO_BOOL_NONE 11,919,360 11,919,360 0.0%
LOAD_ATTR 11,799,660 11,799,660 0.0%
POP_ITER 11,799,540 11,799,540 0.0%
COMPARE_OP 11,799,380 11,799,380 0.0%
LOAD_FAST_AND_CLEAR 11,797,920 11,797,920 0.0%
COPY 11,796,480 11,796,480 0.0%
BUILD_LIST 10,815,000 10,815,000 0.0%
LOAD_CONST_IMMORTAL 10,327,020 10,327,020 0.0%
CALL_LEN 9,338,940 9,338,940 0.0%
COMPARE_OP_INT 9,338,940 9,338,940 0.0%
BINARY_SUBSCR 8,851,020
LOAD_CONST_MORTAL 8,848,740 8,848,740 0.0%
BUILD_TUPLE 8,847,660 8,847,660 0.0%
MAKE_FUNCTION 8,847,600 8,847,600 0.0%
RETURN_GENERATOR 8,847,540 8,847,540 0.0%
CALL_BUILTIN_O 8,847,360 8,847,360 0.0%
STORE_ATTR_INSTANCE_VALUE 1,483,200 1,483,200 0.0%
LOAD_SMALL_INT 986,160 986,160 0.0%
BUILD_MAP 983,040 983,040 0.0%
EXIT_INIT_CHECK 492,960 492,960 0.0%
CALL_ALLOC_AND_ENTER_INIT 492,960 492,960 0.0%
FOR_ITER_RANGE 491,820 491,820 0.0%
CALL_METHOD_DESCRIPTOR_FAST_WITH_KEYWORDS 491,520 491,520 0.0%
FOR_ITER_TUPLE 3,240 3,240 0.0%
BINARY_OP_ADD_INT 2,880 2,880 0.0%
BUILD_SLICE 1,440 1,440 0.0%
CALL_LIST_APPEND 1,440 1,440 0.0%
LOAD_DEREF 660 660 0.0%
LOAD_ATTR_CLASS_WITH_METACLASS_CHECK 540 540 0.0%
PUSH_NULL 540 540 0.0%
FOR_ITER_GEN 540 540 0.0%
CALL 320 320 0.0%
CALL_NON_PY_GENERAL 300 300 0.0%
COPY_FREE_VARS 240 240 0.0%
MAKE_CELL 240 240 0.0%
SET_FUNCTION_ATTRIBUTE 240 240 0.0%
LOAD_ATTR_MODULE 240 240 0.0%
END_FOR 180 180 0.0%
LOAD_GLOBAL 180 180 0.0%
CALL_FUNCTION_EX 120 120 0.0%
CALL_BUILTIN_CLASS 120 120 0.0%
TO_BOOL 100 100 0.0%
NOP 60 60 0.0%
CALL_INTRINSIC_1 60 60 0.0%
FOR_ITER 60 60 0.0%
IS_OP 60 60 0.0%
JUMP_FORWARD 60 60 0.0%
LIST_EXTEND 60 60 0.0%
POP_JUMP_IF_NOT_NONE 60 60 0.0%
STORE_DEREF 60 60 0.0%
STORE_FAST_STORE_FAST 60 60 0.0%
BINARY_OP_SUBTRACT_FLOAT 60 60 0.0%
BINARY_SUBSCR_TUPLE_INT 60
CALL_METHOD_DESCRIPTOR_NOARGS 60 60 0.0%
CALL_METHOD_DESCRIPTOR_O 60 60 0.0%
CALL_PY_GENERAL 60 60 0.0%
UNPACK_SEQUENCE_TWO_TUPLE 60 60 0.0%
UNPACK_SEQUENCE 20 20 0.0%
BINARY_OP_SUBSCR_DICT 26,542,440
BINARY_OP_SUBSCR_TUPLE_INT 60

Pair counts

Pair counts for top 100 opcode pairs

Pairs of specialized operations that deoptimize and are then followed by the corresponding unspecialized instruction are not counted as pairs.

Not included in comparative output.

Predecessor/Successor Pairs

Top 5 predecessors and successors of each Tier 1 opcode.

This does not include the unspecialized instructions that occur after a specialized instruction deoptimizes.

Not included in comparative output.

Specialization stats

Specialization stats by family

BINARY_OP

specialization stats for BINARY_OP family
Kind Base Count Base Ratio Head Count Head Ratio Change
hit

Specialized instructions that complete.

2,940 99.3% 26,545,440 75.0% 902,806.1%
deferred

Lists the number of "deferred" (i.e. not specialized) instructions executed.

8,848,800 25.0%
Success Base Count Base Ratio Head Count Head Ratio Change
Success 20 100.0% 40 1.8% 100.0%
Failure 0 0.0% 2,200 98.2% 2,200 / 0 !!
Failure kind Base Count Base Ratio Head Count Head Ratio Change
out of range 2,160 98.2%
and different types 40 1.8%

CALL

specialization stats for CALL family
Kind Base Count Base Ratio Head Count Head Ratio Change
hit

Specialized instructions that complete.

102,239,820 100.0% 102,239,820 100.0% 0.0%
Success Base Count Base Ratio Head Count Head Ratio Change
Success 320 100.0% 320 100.0% 0.0%
Failure 0 0.0% 0 0.0%

COMPARE_OP

specialization stats for COMPARE_OP family
Kind Base Count Base Ratio Head Count Head Ratio Change
deferred

Lists the number of "deferred" (i.e. not specialized) instructions executed.

11,796,480 55.8% 11,796,480 55.8% 0.0%
hit

Specialized instructions that complete.

9,338,940 44.2% 9,338,940 44.2% 0.0%
Success Base Count Base Ratio Head Count Head Ratio Change
Success 20 0.7% 20 0.7% 0.0%
Failure 2,880 99.3% 2,880 99.3% 0.0%
Failure kind Base Count Base Ratio Head Count Head Ratio Change
baseobject 2,880 100.0% 2,880 100.0% 0.0%

FOR_ITER

specialization stats for FOR_ITER family
Kind Base Count Base Ratio Head Count Head Ratio Change
deferred

Lists the number of "deferred" (i.e. not specialized) instructions executed.

60 0.0% 60 0.0% 0.0%
hit

Specialized instructions that complete.

138,622,560 100.0% 138,622,560 100.0% 0.0%

LOAD_ATTR

specialization stats for LOAD_ATTR family
Kind Base Count Base Ratio Head Count Head Ratio Change
deferred

Lists the number of "deferred" (i.e. not specialized) instructions executed.

11,796,540 6.2% 11,796,540 6.2% 0.0%
hit

Specialized instructions that complete.

177,940,260 93.8% 177,940,260 93.8% 0.0%
miss

Specialized instructions that deopt.

540 0.0% 540 0.0% 0.0%
Success Base Count Base Ratio Head Count Head Ratio Change
Success 220 7.1% 220 7.1% 0.0%
Failure 2,900 92.9% 2,900 92.9% 0.0%
Failure kind Base Count Base Ratio Head Count Head Ratio Change
mutable class 2,880 99.3% 2,880 99.3% 0.0%

LOAD_GLOBAL

specialization stats for LOAD_GLOBAL family
Kind Base Count Base Ratio Head Count Head Ratio Change
hit

Specialized instructions that complete.

30,476,400 100.0% 30,476,400 100.0% 0.0%
Success Base Count Base Ratio Head Count Head Ratio Change
Success 180 100.0% 180 100.0% 0.0%
Failure 0 0.0% 0 0.0%

STORE_ATTR

specialization stats for STORE_ATTR family
Kind Base Count Base Ratio Head Count Head Ratio Change
hit

Specialized instructions that complete.

1,483,200 100.0% 1,483,200 100.0% 0.0%

TO_BOOL

specialization stats for TO_BOOL family
Kind Base Count Base Ratio Head Count Head Ratio Change
deferred

Lists the number of "deferred" (i.e. not specialized) instructions executed.

60 0.0% 60 0.0% 0.0%
hit

Specialized instructions that complete.

28,999,740 69.0% 28,999,740 69.0% 0.0%
miss

Specialized instructions that deopt.

13,025,280 31.0% 13,025,280 31.0% 0.0%
Success Base Count Base Ratio Head Count Head Ratio Change
Success 245,780 100.0% 245,780 100.0% 0.0%
Failure 20 0.0% 20 0.0% 0.0%
Failure kind Base Count Base Ratio Head Count Head Ratio Change
sequence 20 100.0% 20 100.0% 0.0%

UNPACK_SEQUENCE

specialization stats for UNPACK_SEQUENCE family
Kind Base Count Base Ratio Head Count Head Ratio Change
hit

Specialized instructions that complete.

60 75.0% 60 75.0% 0.0%
Success Base Count Base Ratio Head Count Head Ratio Change
Success 20 100.0% 20 100.0% 0.0%
Failure 0 0.0% 0 0.0%

Specialization effectiveness

specialization effectiveness

All entries are execution counts. Should add up to the total number of Tier 1 instructions executed.

Instructions Base Count Base Ratio Head Count Head Ratio Change
Basic

Instructions that are not and cannot be specialized, e.g. LOAD_FAST.

727,522,860 49.5% 727,522,860 49.5% 0.0%
Not specialized

Instructions that could be specialized but aren't, e.g. LOAD_ATTR, BINARY_SLICE.

32,450,760 2.2% 32,450,760 2.2% 0.0%
Specialized hits

Specialized instructions, e.g. LOAD_ATTR_MODULE that complete.

697,529,280 47.4% 697,529,280 47.4% 0.0%
Specialized misses

Specialized instructions, e.g. LOAD_ATTR_MODULE that deopt.

13,025,820 0.9% 13,025,820 0.9% 0.0%

Deferred by instruction

Breakdown of deferred (not specialized) instruction counts by family
Name Base Count Base Ratio Head Count Head Ratio Change
LOAD_ATTR 11,796,540 36.4% 11,796,540 36.4% 0.0%
COMPARE_OP 11,796,480 36.4% 11,796,480 36.4% 0.0%
BINARY_SUBSCR 8,848,800 27.3%
TO_BOOL 60 0.0% 60 0.0% 0.0%
FOR_ITER 60 0.0% 60 0.0% 0.0%
BINARY_SLICE 0 0.0% 0 0.0%
STORE_SLICE 0 0.0% 0 0.0%
CACHE 0 0.0% 0 0.0%
CALL_FUNCTION_EX 0 0.0% 0 0.0%
END_FOR 0 0.0% 0 0.0%
BINARY_OP 8,848,800 27.3%

Misses by instruction

Breakdown of misses (specialized deopts) instruction counts by family
Name Base Count Base Ratio Head Count Head Ratio Change
TO_BOOL_ALWAYS_TRUE 6,512,640 50.0% 6,512,640 50.0% 0.0%
TO_BOOL_NONE 6,512,640 50.0% 6,512,640 50.0% 0.0%
LOAD_ATTR_CLASS_WITH_METACLASS_CHECK 540 0.0% 540 0.0% 0.0%
CACHE 0 0.0% 0 0.0%
CALL_FUNCTION_EX 0 0.0% 0 0.0%
END_FOR 0 0.0% 0 0.0%
EXIT_INIT_CHECK 0 0.0% 0 0.0%
GET_ITER 0 0.0% 0 0.0%
INTERPRETER_EXIT 0 0.0% 0 0.0%
MAKE_FUNCTION 0 0.0% 0 0.0%

Call stats

Inlined calls and frame stats

This shows what fraction of calls to Python functions are inlined (i.e. not having a call at the C level) and for those that are not, where the call comes from. The various categories overlap.

Also includes the count of frame objects created.

Base Count Base Ratio Head Count Head Ratio Change
Calls to PyEval_EvalDefault 14,745,840 32.6% 14,745,840 32.6% 0.0%
Calls to Python functions inlined 30,476,820 67.4% 30,476,820 67.4% 0.0%
Calls via PyEval_EvalFrame (total) 14,745,840 32.6% 14,745,840 32.6% 0.0%
Calls via PyEval_EvalFrame (vector) 240 0.0% 240 0.0% 0.0%
Calls via PyEval_EvalFrame (generator) 14,745,600 32.6% 14,745,600 32.6% 0.0%
Calls via PyEval_EvalFrame (legacy) 0 0.0% 0 0.0%
Calls via PyEval_EvalFrame (function vectorcall) 240 0.0% 240 0.0% 0.0%
Calls via PyEval_EvalFrame (build class) 0 0.0% 0 0.0%
Calls via PyEval_EvalFrame (slot) 0 0.0% 0 0.0%
Calls via PyEval_EvalFrame (function ex) 60 0.0% 60 0.0% 0.0%
Calls via PyEval_EvalFrame (api) 180 0.0% 180 0.0% 0.0%
Calls via PyEval_EvalFrame (method) 0 0.0% 0 0.0%
Frame objects created 0 0.0% 0 0.0%
Frames pushed 30,969,480 68.5% 30,969,480 68.5% 0.0%

Object stats

Allocations, frees and dict materializatons

Below, "allocations" means "allocations that are not from a freelist". Total allocations = "Allocations from freelist" + "Allocations".

"Inline values" is the number of values arrays inlined into objects.

The cache hit/miss numbers are for the MRO cache, split into dunder and other names.

Base Count Base Ratio Head Count Head Ratio Change
Method cache dunder hits 180 2,376 1,220.0%
Method cache collisions 27 30 11.1%
Method cache misses 35 33 -5.7%
Mortal decrefs 137,644,395 12.0% 137,646,595 12.0% 0.0%
Mortal increfs 163,204,035 15.7% 163,206,233 15.8% 0.0%
Method cache hits 23,599,985 23,599,987 0.0%
Frees 31,462,440 31,462,442 0.0%
Immortal increfs 108,142,215 10.4% 108,142,221 10.4% 0.0%
Immortal decrefs 191,222,435 16.6% 191,222,439 16.6% 0.0%
Allocations from freelist 41,280,080 66.1% 41,280,080 66.1% 0.0%
Frees to freelist 41,279,980 41,279,980 0.0%
Allocations 21,139,180 33.9% 21,139,180 33.9% 0.0%
Allocations to 512 bytes 20,156,140 32.3% 20,156,140 32.3% 0.0%
Allocations to 4 kbytes 983,040 1.6% 983,040 1.6% 0.0%
Allocations over 4 kbytes 0 0.0% 0 0.0%
Inline values 492,960 492,960 0.0%
Interpreter mortal increfs 516,634,680 49.9% 516,634,680 49.9% 0.0%
Interpreter mortal decrefs 601,662,700 52.3% 601,662,700 52.3% 0.0%
Interpreter immortal increfs 248,245,380 24.0% 248,245,380 24.0% 0.0%
Interpreter immortal decrefs 219,258,720 19.1% 219,258,720 19.1% 0.0%
Materialize dict (on request) 0 0.0% 0 0.0%
Materialize dict (new key) 0 0.0% 0 0.0%
Materialize dict (too big) 0 0.0% 0 0.0%
Materialize dict (str subclass) 0 0.0% 0 0.0%
Method cache dunder misses 0 4 4 / 0 !!

GC stats

GC collections and effectiveness

Collected/visits gives some measure of efficiency.

Generation Base Collections Base Objects collected Base Object visits Base Reachable from roots Base Not reachable from roots Head Collections Head Objects collected Head Object visits Head Reachable from roots Head Not reachable from roots
0 0 0 0 0 0 0 0 0 0 0
1 0 0 0 0 0 0 0 0 0 0
2 0 0 0 0 0 0 0 0 0 0

Optimization (Tier 2) stats

statistics about the Tier 2 optimizer

Rare events

Counts of rare/unlikely events
Event Base Count Head Count Change
set class

Setting an object's class, obj.__class__ = ...

0 0
set bases

Setting the bases of a class, cls.__bases__ = ...

0 0
set eval frame func

Setting the PEP 523 frame eval function _PyInterpreterState_SetFrameEvalFunc()

0 0
builtin dict

Modifying the builtins, __builtins__.__dict__[var] = ...

0 0
func modification

Modifying a function, e.g. func.__defaults__ = ..., etc.

0 0
watched dict modification

A watched dict has been modified

0 0
watched globals modification

A watched globals() dict has been modified

0 0

Meta stats

Meta statistics
Base Count Head Count Change
Number of data files 20 20 0.0%

Stats gathered on: 2025-02-06