GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing github.com — Reduce padding in `_PyCfgBasicblock` · Issue #160132 · python/cpython Closed Labels interpreter-core(Objects, Python, Grammar, and Parser dirs)(Objects, Python, Grammar, and Parser dirs)type-featureA feature request or enhancementA feature request or enhancement DescriptionFeature or enhancementOn my x86-64 build,
Moving the five bit-fields immediately after This would save 8 bytes per CFG block before allocator rounding. With the standard 64-bit pymalloc size classes, the allocation would also move from the 80-byte class to the 64-byte class. The proposed change is limited to the layout of this internal structure. No compiler behavior or public API changes are intended. Compilation performance has not been benchmarked. ❯ pahole -C _PyCfgBasicblock Python/flowgraph.ostruct _PyCfgBasicblock { struct _PyCfgBasicblock * b_list; /* 0 8 */ _PyJumpTargetLabel b_label; /* 8 4 */ /* XXX 4 bytes hole, try to pack */ struct _PyCfgExceptStack * b_exceptstack; /* 16 8 */ cfg_instr * b_instr; /* 24 8 */ struct _PyCfgBasicblock * b_next; /* 32 8 */ int b_iused; /* 40 4 */ int b_ialloc; /* 44 4 */ uint64_t b_unsafe_locals_mask; /* 48 8 */ int b_predecessors; /* 56 4 */ int b_startdepth; /* 60 4 */ /* --- cacheline 1 boundary (64 bytes) --- */ unsigned int b_preserve_lasti:1; /* 64: 0 4 */ unsigned int b_visited:1; /* 64: 1 4 */ unsigned int b_except_handler:1; /* 64: 2 4 */ unsigned int b_cold:1; /* 64: 3 4 */ unsigned int b_warm:1; /* 64: 4 4 */ /* size: 72, cachelines: 2, members: 15 */ /* sum members: 60, holes: 1, sum holes: 4 */ /* sum bitfield members: 5 bits (0 bytes) */ /* padding: 4 */ /* bit_padding: 27 bits */ /* last cacheline: 8 bytes */ }; Has this already been discussed elsewhere?This is a minor feature, which does not need previous discussion elsewhere Links to previous discussion of this feature:No response Linked PRsActivity
MetadataMetadataAssigneesLabelsinterpreter-core(Objects, Python, Grammar, and Parser dirs)(Objects, Python, Grammar, and Parser dirs)type-featureA feature request or enhancementA feature request or enhancement ProjectsMilestoneRelationshipsDevelopmentIssue actions |
| You are visitor 01402520 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |