()
| 1098 | |
| 1099 | |
| 1100 | def call_stats_section() -> Section: |
| 1101 | def calc_call_stats_table(stats: Stats) -> Rows: |
| 1102 | call_stats = stats.get_call_stats() |
| 1103 | total = sum(v for k, v in call_stats.items() if "Calls to" in k) |
| 1104 | return [ |
| 1105 | (key, Count(value), Ratio(value, total)) |
| 1106 | for key, value in call_stats.items() |
| 1107 | ] |
| 1108 | |
| 1109 | return Section( |
| 1110 | "Call stats", |
| 1111 | "Inlined calls and frame stats", |
| 1112 | [ |
| 1113 | Table( |
| 1114 | ("", "Count:", "Ratio:"), |
| 1115 | calc_call_stats_table, |
| 1116 | JoinMode.CHANGE, |
| 1117 | ) |
| 1118 | ], |
| 1119 | doc=""" |
| 1120 | This shows what fraction of calls to Python functions are inlined (i.e. |
| 1121 | not having a call at the C level) and for those that are not, where the |
| 1122 | call comes from. The various categories overlap. |
| 1123 | |
| 1124 | Also includes the count of frame objects created. |
| 1125 | """, |
| 1126 | ) |
| 1127 | |
| 1128 | |
| 1129 | def object_stats_section() -> Section: |
no test coverage detected
searching dependent graphs…