mirror of
https://github.com/python/cpython.git
synced 2025-08-03 16:39:00 +00:00
bpo-46072: Add some object layout and allocation stats (GH-31051)
This commit is contained in:
parent
913e340a32
commit
48be46ec1f
5 changed files with 51 additions and 1 deletions
|
@ -171,10 +171,22 @@ print_call_stats(FILE *out, CallStats *stats)
|
|||
fprintf(out, "Calls to Python functions inlined: %" PRIu64 "\n", stats->inlined_py_calls);
|
||||
}
|
||||
|
||||
static void
|
||||
print_object_stats(FILE *out, ObjectStats *stats)
|
||||
{
|
||||
fprintf(out, "Object allocations: %" PRIu64 "\n", stats->allocations);
|
||||
fprintf(out, "Object frees: %" PRIu64 "\n", stats->frees);
|
||||
fprintf(out, "Object new values: %" PRIu64 "\n", stats->new_values);
|
||||
fprintf(out, "Object materialize dict (on request): %" PRIu64 "\n", stats->dict_materialized_on_request);
|
||||
fprintf(out, "Object materialize dict (new key): %" PRIu64 "\n", stats->dict_materialized_new_key);
|
||||
fprintf(out, "Object materialize dict (too big): %" PRIu64 "\n", stats->dict_materialized_too_big);
|
||||
}
|
||||
|
||||
static void
|
||||
print_stats(FILE *out, PyStats *stats) {
|
||||
print_spec_stats(out, stats->opcode_stats);
|
||||
print_call_stats(out, &stats->call_stats);
|
||||
print_object_stats(out, &stats->object_stats);
|
||||
}
|
||||
|
||||
void
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue