GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — bpo-43950: optimize column table assembling with pre-sizing the column table by isidentical · Pull Request #26997 · python/cpython

Conversation

@isidentical

@isidentical isidentical commented Jul 2, 2021 •
edited by miss-islington
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member

The new resizing system works like this;

$ cat t.py
a + a + a + b + c + a + a + a + b + c + a + a + a + b + c + a + a + a + b + c
[repeated 99 more times]
$ ./python t.py
RESIZE: prev len = 32, new len = 66
FINAL SIZE: 56
-----------------------------------------------------
RESIZE: prev len = 32, new len = 66
RESIZE: prev len = 66, new len = 134
RESIZE: prev len = 134, new len = 270
RESIZE: prev len = 270, new len = 542
RESIZE: prev len = 542, new len = 1086
RESIZE: prev len = 1086, new len = 2174
RESIZE: prev len = 2174, new len = 4350
RESIZE: prev len = 4350, new len = 8702
FINAL SIZE: 8004

So now we do considerably lower number of _PyBytes_Resize calls.

https://bugs.python.org/issue43950

Automerge-Triggered-By: GH:isidentical

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@isidentical
bpo-43950: optimize column table assembling with pre-sizing object
760daf9
@isidentical
isidentical requested a review from markshannon as a code owner July 2, 2021 17:34
@the-knights-who-say-ni the-knights-who-say-ni added the CLA signed label Jul 2, 2021
@bedevere-bot bedevere-bot added the awaiting core review label Jul 2, 2021
@isidentical isidentical added the skip news label Jul 2, 2021
pablogsal
pablogsal approved these changes Jul 2, 2021
View reviewed changes

@pablogsal pablogsal left a comment

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

I can confirm that this speeds up the allocation quite a lot as expected 👍

❯ time ./python -m test test_compile -m test_stack_overflow -v
== CPython 3.11.0a0 (heads/optimize-co-positions:760daf9858, Jul 2 2021, 19:08:05) [GCC 11.1.0]
== Linux-5.12.13-arch1-2-x86_64-with-glibc2.33 little-endian
== cwd: /home/pablogsal/github/python/main/build/test_python_15988æ
== CPU count: 36
== encodings: locale=UTF-8, FS=utf-8
0:00:00 load avg: 2.15 Run tests sequentially
0:00:00 load avg: 2.15 [1/1] test_compile
test_stack_overflow (test.test_compile.TestSpecifics) ... ok

----------------------------------------------------------------------

Ran 1 test in 3.945s

OK

== Tests result: SUCCESS ==

1 test OK.

Total duration: 4.0 sec
Tests result: SUCCESS
./python -m test test_compile -m test_stack_overflow -v  3.77s user 0.47s system 99% cpu 4.241 total

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@bedevere-bot bedevere-bot added awaiting merge and removed awaiting core review labels Jul 2, 2021
@isidentical isidentical added the 🤖 automerge label Jul 2, 2021
@miss-islington

miss-islington commented Jul 2, 2021

Copy link
Copy Markdown
Contributor

@isidentical: Status check is done, and it's a success ❌ .

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@isidentical

isidentical commented Jul 2, 2021

Copy link
Copy Markdown
Member Author

concurrent_futures error, irrelevant, restarting the CI

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@miss-islington

miss-islington commented Jul 2, 2021

Copy link
Copy Markdown
Contributor

@isidentical: Status check is done, and it's a success ✅ .

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@miss-islington

miss-islington commented Jul 2, 2021

Copy link
Copy Markdown
Contributor

Sorry, I can't merge this PR. Reason: 3 of 5 required status checks have not succeeded: 2 expected..

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@miss-islington

miss-islington commented Jul 2, 2021

Copy link
Copy Markdown
Contributor

@isidentical: Status check is done, and it's a success ✅ .

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@miss-islington
miss-islington merged commit ec8759b into python:main Jul 2, 2021
@bedevere-bot bedevere-bot removed the awaiting merge label Jul 2, 2021
@isidentical isidentical changed the title bpo-43950: optimize column table assembling with pre-sizing object bpo-43950: optimize column table assembling with pre-sizing the column table Jul 3, 2021
@pablogsal pablogsal mentioned this pull request Apr 13, 2022
Include column offsets for bytecode instructions #88116
Closed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@pablogsal pablogsal pablogsal approved these changes
@markshannon markshannon Awaiting requested review from markshannon markshannon is a code owner

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

skip news

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

5 participants

@isidentical @miss-islington @pablogsal @the-knights-who-say-ni @bedevere-bot
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — 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.