Skip to content

gh-102860: improve performance of compiler's instr_sequence_to_cfg - #102861

Merged
iritkatriel merged 2 commits into
python:mainfrom
iritkatriel:instr_sequence_to_cfg-perf
Mar 21, 2023
Merged

gh-102860: improve performance of compiler's instr_sequence_to_cfg#102861
iritkatriel merged 2 commits into
python:mainfrom
iritkatriel:instr_sequence_to_cfg-perf

Conversation

@iritkatriel

@iritkatriel iritkatriel commented Mar 21, 2023

Copy link
Copy Markdown
Member

@iritkatriel iritkatriel added the 🔨 test-with-buildbots Test PR w/ buildbots; report in status section label Mar 21, 2023
@bedevere-bot

Copy link
Copy Markdown

🤖 New build scheduled with the buildbot fleet by @iritkatriel for commit 4a84199 🤖

If you want to schedule another build, you need to add the 🔨 test-with-buildbots label again.

@bedevere-bot bedevere-bot removed the 🔨 test-with-buildbots Test PR w/ buildbots; report in status section label Mar 21, 2023
Comment thread Python/compile.c
Comment on lines +631 to +637
if (HAS_TARGET(opcode)) {
int offset = seq->s_labelmap[oparg];
assert(offset >= 0 && offset < seq->s_used);
int lbl = offset2lbl[offset];
assert(lbl >= 0 && lbl < seq->s_labelmap_size);
oparg = lbl;
}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess this is required now because we only call cfg_builder_use_label for the one canonical label for an offset, rather than for every label? So we have to ensure we use the canonical label for jump targets also.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, exactly.

@iritkatriel
iritkatriel merged commit 8d015fa into python:main Mar 21, 2023
Fidget-Spinner pushed a commit to Fidget-Spinner/cpython that referenced this pull request Mar 27, 2023
@iritkatriel
iritkatriel deleted the instr_sequence_to_cfg-perf branch April 3, 2023 17:42
warsaw pushed a commit to warsaw/cpython that referenced this pull request Apr 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

interpreter-core (Objects, Python, Grammar, and Parser dirs) skip news

Projects

None yet

Development

Successfully merging this pull request may close these issues.

test.compile.test_stack_overflow is very slow

3 participants