8000 bpo-46072: Add some object layout stats by markshannon · Pull Request #31051 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

bpo-46072: Add some object layout stats #31051

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

Merged
merged 3 commits into from
Feb 1, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Remove misleading 'new dict' stat.
  • Loading branch information
markshannon committed Feb 1, 2022
commit 36d165458846e3d2b6dbc5309938c9995dc2e9b5
1 change: 0 additions & 1 deletion Include/internal/pycore_code.h
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,6 @@ typedef struct _object_stats {
uint64_t allocations;
uint64_t frees;
uint64_t new_values;
uint64_t new_dict;
uint64_t dict_materialized_on_request;
uint64_t dict_materialized_new_key;
uint64_t dict_materialized_too_big;
Expand Down
2 changes: 0 additions & 2 deletions Objects/dictobject.c
Original file line number Diff line number Diff line change
Expand Up @@ -4997,11 +4997,9 @@ _PyObject_InitializeDict(PyObject *obj)
PyObject *dict;
if (_PyType_HasFeature(tp, Py_TPFLAGS_HEAPTYPE) && CACHED_KEYS(tp)) {
dictkeys_incref(CACHED_KEYS(tp));
OBJECT_STAT_INC(new_dict);
dict = new_dict_with_shared_keys(CACHED_KEYS(tp));
}
else {
OBJECT_STAT_INC(new_dict);
dict = PyDict_New();
}
if (dict == NULL) {
Expand Down
1 change: 0 additions & 1 deletion Python/specialize.c
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,6 @@ 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 new dicts: %" PRIu64 "\n", stats->new_dict);
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);
Expand Down
0