René's URL Explorer Experiment


Title: bpo-28638: Optimize namedtuple() creation time by minimizing use of exec() by rhettinger · Pull Request #3454 · python/cpython · GitHub

Open Graph Title: bpo-28638: Optimize namedtuple() creation time by minimizing use of exec() by rhettinger · Pull Request #3454 · python/cpython

X Title: bpo-28638: Optimize namedtuple() creation time by minimizing use of exec() by rhettinger · Pull Request #3454 · python/cpython

Description: Current version passes tests but doesn't not support the _source attribute or the verbose option. Obtains a 5x creation time speed-up and with small positive impacts on post creation performance. =============== Baseline =============== Cumulative time over 10,000 iterations: 0.044 arg_checking 0.238 templating 2.907 exec 3.257 all Total with call overhead: 3.270 seconds ===== This verion ====== Cumulative time over 10,000 iterations: 0.073 arg_checking 0.306 template_and_exec 0.207 non_exec 0.626 all Total with call overhead: 0.639 seconds Ideas going forward Cache the itemgetter instances Generate _source dynamically Need to compare to Jelle's patch https://bugs.python.org/issue28638

Open Graph Description: Current version passes tests but doesn't not support the _source attribute or the verbose option. Obtains a 5x creation time speed-up and with small positive impacts on post creation performanc...

X Description: Current version passes tests but doesn't not support the _source attribute or the verbose option. Obtains a 5x creation time speed-up and with small positive impacts on post creation perfor...

Opengraph URL: https://github.com/python/cpython/pull/3454

X: @github

direct link

Domain: github.com

route-pattern/:user_id/:repository/pull/:id/files(.:format)
route-controllerpull_requests
route-actionfiles
fetch-noncev2:eafed271-e735-daad-9449-9cb2fa6c2f8b
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-idAACA:2373EB:1F09D9D:2A7B99A:6A4F2FD6
html-safe-nonce9bf840776aceb2eb061d131b0b2ed19ceae85373c81f10f0546db343cb551d9f
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBQUNBOjIzNzNFQjoxRjA5RDlEOjJBN0I5OUE6NkE0RjJGRDYiLCJ2aXNpdG9yX2lkIjoiMTE3NDE2MjYxMDc1MDE3MzE0MiIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmacf8008f696b5c888afc7e25600d87f7266cf867db7baf885315bc2911f2b3a3ac
hovercard-subject-tagpull_request:139969979
github-keyboard-shortcutsrepository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///pull_requests/show/files
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/python/cpython/pull/3454/files
twitter:imagehttps://avatars.githubusercontent.com/u/1623689?s=400&v=4
twitter:cardsummary_large_image
og:imagehttps://avatars.githubusercontent.com/u/1623689?s=400&v=4
og:image:altCurrent version passes tests but doesn't not support the _source attribute or the verbose option. Obtains a 5x creation time speed-up and with small positive impacts on post creation performanc...
og:site_nameGitHub
og:typeobject
hostnamegithub.com
expected-hostnamegithub.com
Noneb92d11c0aa4a77d54ef4af1078b6a15fb5a70a215b30c4ecf28889d5a8e656d9
turbo-cache-controlno-preview
diff-viewunified
go-importgithub.com/python/cpython git https://github.com/python/cpython.git
octolytics-dimension-user_id1525981
octolytics-dimension-user_loginpython
octolytics-dimension-repository_id81598961
octolytics-dimension-repository_nwopython/cpython
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id81598961
octolytics-dimension-repository_network_root_nwopython/cpython
turbo-body-classeslogged-out env-production page-responsive full-width
disable-turbotrue
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release2b8f23afb982271f1b22258a94aede67a6b77760
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/python/cpython/pull/3454/files#start-of-content
https://github.com/
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpython%2Fcpython%2Fpull%2F3454%2Ffiles
GitHub CopilotWrite better code with AIhttps://github.com/features/copilot
GitHub Copilot appDirect agents from issue to mergehttps://github.com/features/ai/github-app
MCP RegistryNewIntegrate external toolshttps://github.com/mcp
ActionsAutomate any workflowhttps://github.com/features/actions
CodespacesInstant dev environmentshttps://github.com/features/codespaces
IssuesPlan and track workhttps://github.com/features/issues
Code ReviewManage code changeshttps://github.com/features/code-review
GitHub Advanced SecurityFind and fix vulnerabilitieshttps://github.com/security/advanced-security
Code securitySecure your code as you buildhttps://github.com/security/advanced-security/code-security
Secret protectionStop leaks before they starthttps://github.com/security/advanced-security/secret-protection
Why GitHubhttps://github.com/why-github
Documentationhttps://docs.github.com
Bloghttps://github.blog
Changeloghttps://github.blog/changelog
Marketplacehttps://github.com/marketplace
View all featureshttps://github.com/features
Enterpriseshttps://github.com/enterprise
Small and medium teamshttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
App Modernizationhttps://github.com/solutions/use-case/app-modernization
DevSecOpshttps://github.com/solutions/use-case/devsecops
DevOpshttps://github.com/solutions/use-case/devops
CI/CDhttps://github.com/solutions/use-case/ci-cd
View all use caseshttps://github.com/solutions/use-case
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
View all industrieshttps://github.com/solutions/industry
View all solutionshttps://github.com/solutions
AIhttps://github.com/resources/articles?topic=ai
Software Developmenthttps://github.com/resources/articles?topic=software-development
DevOpshttps://github.com/resources/articles?topic=devops
Securityhttps://github.com/resources/articles?topic=security
View all topicshttps://github.com/resources/articles
Customer storieshttps://github.com/customer-stories
Events & webinarshttps://github.com/resources/events
Ebooks & reportshttps://github.com/resources/whitepapers
Business insightshttps://github.com/solutions/executive-insights
GitHub Skillshttps://skills.github.com
Documentationhttps://docs.github.com
Customer supporthttps://support.github.com
Community forumhttps://github.com/orgs/community/discussions
Trust centerhttps://github.com/trust-center
Partnershttps://github.com/partners
View all resourceshttps://github.com/resources
GitHub SponsorsFund open source developershttps://github.com/open-source/sponsors
Security Labhttps://securitylab.github.com
Maintainer Communityhttps://maintainers.github.com
Acceleratorhttps://github.com/open-source/accelerator
GitHub Starshttps://stars.github.com
Archive Programhttps://archiveprogram.github.com
Topicshttps://github.com/topics
Trendinghttps://github.com/trending
Collectionshttps://github.com/collections
Enterprise platformAI-powered developer platformhttps://github.com/enterprise
GitHub Advanced SecurityEnterprise-grade security featureshttps://github.com/security/advanced-security
Copilot for BusinessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Pricinghttps://github.com/pricing
Search syntax tipshttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
documentationhttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpython%2Fcpython%2Fpull%2F3454%2Ffiles
Sign up https://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fpull_requests%2Fshow%2Ffiles&source=header-repo&source_repo=python%2Fcpython
Reloadhttps://github.com/python/cpython/pull/3454/files
Reloadhttps://github.com/python/cpython/pull/3454/files
Reloadhttps://github.com/python/cpython/pull/3454/files
Please reload this pagehttps://github.com/python/cpython/pull/3454/files
python https://github.com/python
cpythonhttps://github.com/python/cpython
Please reload this pagehttps://github.com/python/cpython/pull/3454/files
Notifications https://github.com/login?return_to=%2Fpython%2Fcpython
Fork 34.8k https://github.com/login?return_to=%2Fpython%2Fcpython
Star 73.6k https://github.com/login?return_to=%2Fpython%2Fcpython
Code https://github.com/python/cpython
Issues 5k+ https://github.com/python/cpython/issues
Pull requests 2.3k https://github.com/python/cpython/pulls
Actions https://github.com/python/cpython/actions
Projects https://github.com/python/cpython/projects
Security and quality 0 https://github.com/python/cpython/security
Insights https://github.com/python/cpython/pulse
Code https://github.com/python/cpython
Issues https://github.com/python/cpython/issues
Pull requests https://github.com/python/cpython/pulls
Actions https://github.com/python/cpython/actions
Projects https://github.com/python/cpython/projects
Security and quality https://github.com/python/cpython/security
Insights https://github.com/python/cpython/pulse
Sign up for GitHub https://github.com/signup?return_to=%2Fpython%2Fcpython%2Fissues%2Fnew%2Fchoose
terms of servicehttps://docs.github.com/terms
privacy statementhttps://docs.github.com/privacy
Sign inhttps://github.com/login?return_to=%2Fpython%2Fcpython%2Fissues%2Fnew%2Fchoose
rhettingerhttps://github.com/rhettinger
python:masterhttps://github.com/python/cpython/tree/master
rhettinger:optimize-namedtuplehttps://github.com/rhettinger/cpython/tree/optimize-namedtuple
Conversation 31 https://github.com/python/cpython/pull/3454
Commits 23 https://github.com/python/cpython/pull/3454/commits
Checks 0 https://github.com/python/cpython/pull/3454/checks
Files changed https://github.com/python/cpython/pull/3454/files
Please reload this pagehttps://github.com/python/cpython/pull/3454/files
bpo-28638: Optimize namedtuple() creation time by minimizing use of exec() https://github.com/python/cpython/pull/3454/files#top
Show all changes 23 commits https://github.com/python/cpython/pull/3454/files
baca675 Working draft without _source rhettinger Sep 8, 2017 https://github.com/python/cpython/pull/3454/commits/baca675956bab1c58c393a223d55c31ffc56e310
3a2aa41 Re-use itemgetter() instances rhettinger Sep 8, 2017 https://github.com/python/cpython/pull/3454/commits/3a2aa415618ef45af68f21afbd1ce56f95693c9c
e24ef4b Speed-up calls to __new__() with a pre-bound tuple.__new__() rhettinger Sep 8, 2017 https://github.com/python/cpython/pull/3454/commits/e24ef4beb1cbb90639af13bc09a367bf54c7a48c
49aa967 Add note regarding string interning rhettinger Sep 8, 2017 https://github.com/python/cpython/pull/3454/commits/49aa967264c56110863bf87acb5c2303c4c61c01
c34b444 Remove unnecessary create function wrappers rhettinger Sep 8, 2017 https://github.com/python/cpython/pull/3454/commits/c34b44488feb94901b5c224989d72bbddb1d9786
0c7f163 Minor sync-ups with PR-2736. Mostly formatting and f-strings rhettinger Sep 8, 2017 https://github.com/python/cpython/pull/3454/commits/0c7f16393c33350809396cc6c3491c1e767f0805
5de0b7f Bring-in qualname/__module fix-ups from PR-2736 rhettinger Sep 8, 2017 https://github.com/python/cpython/pull/3454/commits/5de0b7fd80bf9db74ea136b4d16d1cfb5a2aff28
ca643f4 Formally remove the verbose flag and _source attribute rhettinger Sep 8, 2017 https://github.com/python/cpython/pull/3454/commits/ca643f4acb542c64cb6aae58ce06b5d4e11f6e7c
e18b92e Restore a test of potentially problematic field names rhettinger Sep 8, 2017 https://github.com/python/cpython/pull/3454/commits/e18b92ed04e43b914ddc0f3acf69e5dbef848ef8
0851fc7 Restore kwonly_args test but without the verbose option rhettinger Sep 8, 2017 https://github.com/python/cpython/pull/3454/commits/0851fc76dbdeef765ca070208f505e29b7b8d1e8
3ac1151 Adopt Inada's idea to reuse the docstrings for the itemgetters rhettinger Sep 8, 2017 https://github.com/python/cpython/pull/3454/commits/3ac1151fda5bbfb8da18c7c44b56477fbe71293a
b31f063 Neaten-up a bit rhettinger Sep 8, 2017 https://github.com/python/cpython/pull/3454/commits/b31f0639f3f83ca4a7a98715a2693742a97bf8f6
deb30a2 Add news blurb rhettinger Sep 8, 2017 https://github.com/python/cpython/pull/3454/commits/deb30a2fe688832de98c2ebfd962d060d54d5ef6
f402cb3 Merge branch 'master' of github.com:python/cpython into optimize-name… rhettinger Sep 9, 2017 https://github.com/python/cpython/pull/3454/commits/f402cb3a1a890e0bd5451680a3c78ebff868f448
86cef9e Serhiy pointed-out the need for interning rhettinger Sep 9, 2017 https://github.com/python/cpython/pull/3454/commits/86cef9e8ef80217dcb93e2f11821683a91930faa
83b5e93 Jelle noticed as missing f on an f-string rhettinger Sep 9, 2017 https://github.com/python/cpython/pull/3454/commits/83b5e93876ea47b81a476c79767306cb474b9152
0168317 Add whatsnew entry for feature removal rhettinger Sep 9, 2017 https://github.com/python/cpython/pull/3454/commits/0168317c6ebf19be74990479003eb8d81faf7694
dadafc0 Accede to request for dict literals instead keyword arguments rhettinger Sep 9, 2017 https://github.com/python/cpython/pull/3454/commits/dadafc06fd0ff8fc9f78511d73ca6b1485b17791
483d08c Leave the method.__module__ attribute pointing the actual location of… rhettinger Sep 9, 2017 https://github.com/python/cpython/pull/3454/commits/483d08c4e9b949703a3bc2eae73095b4cdc739b1
bc6852c Improve variable names and add a micro-optimization for an non-public… rhettinger Sep 10, 2017 https://github.com/python/cpython/pull/3454/commits/bc6852c014cda6be19d8f39daca1966a9b9d5536
c897674 Simplify by in-lining reuse_itemgetter() rhettinger Sep 10, 2017 https://github.com/python/cpython/pull/3454/commits/c8976744fc3ac2f03c25d942c02271b29cb6352c
bd4ea4e Arrange steps in more logical order rhettinger Sep 10, 2017 https://github.com/python/cpython/pull/3454/commits/bd4ea4ece39fd46a953e7c284e4ee6cc4bfc72dd
ffb78c9 Save docstring in local cache instead of interning rhettinger Sep 10, 2017 https://github.com/python/cpython/pull/3454/commits/ffb78c991e6c2d1719e73ae6b9900fe143f97467
Clear filters https://github.com/python/cpython/pull/3454/files
Please reload this pagehttps://github.com/python/cpython/pull/3454/files
Please reload this pagehttps://github.com/python/cpython/pull/3454/files
collections.rst https://github.com/python/cpython/pull/3454/files#diff-5251b40283a63a061147a0ae32017c629d88a95d1c363d4e47f37b7969a4b0e3
3.7.rst https://github.com/python/cpython/pull/3454/files#diff-830b405713d1c40982ffa918864e39c40c1b318d79b8dd2b523646dc3bd18b52
__init__.py https://github.com/python/cpython/pull/3454/files#diff-c92f871cb9b4aa1583c89f82cd416d58a5d70fff41faf41e45dedf775dbe7713
test_collections.py https://github.com/python/cpython/pull/3454/files#diff-a2a882635e20e8e9439f090d33513502a7af648286efebfa4e4bc37270c44784
2017-09-08-14-31-15.bpo-28638.lfbVyH.rst https://github.com/python/cpython/pull/3454/files#diff-92c26e6a7507d9b816ef262340ad326ca3d0ea9e531eeecf69108a9d41e7e231
Doc/library/collections.rsthttps://github.com/python/cpython/pull/3454/files#diff-5251b40283a63a061147a0ae32017c629d88a95d1c363d4e47f37b7969a4b0e3
View file https://github.com/rhettinger/cpython/blob/ffb78c991e6c2d1719e73ae6b9900fe143f97467/Doc/library/collections.rst
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/python/cpython/pull/3454/{{ revealButtonHref }}
https://github.com/python/cpython/pull/3454/files#diff-5251b40283a63a061147a0ae32017c629d88a95d1c363d4e47f37b7969a4b0e3
https://github.com/python/cpython/pull/3454/files#diff-5251b40283a63a061147a0ae32017c629d88a95d1c363d4e47f37b7969a4b0e3
https://github.com/python/cpython/pull/3454/files#diff-5251b40283a63a061147a0ae32017c629d88a95d1c363d4e47f37b7969a4b0e3
https://github.com/python/cpython/pull/3454/files#diff-5251b40283a63a061147a0ae32017c629d88a95d1c363d4e47f37b7969a4b0e3
https://github.com/python/cpython/pull/3454/files#diff-5251b40283a63a061147a0ae32017c629d88a95d1c363d4e47f37b7969a4b0e3
https://github.com/python/cpython/pull/3454/files#diff-5251b40283a63a061147a0ae32017c629d88a95d1c363d4e47f37b7969a4b0e3
Doc/whatsnew/3.7.rsthttps://github.com/python/cpython/pull/3454/files#diff-830b405713d1c40982ffa918864e39c40c1b318d79b8dd2b523646dc3bd18b52
View file https://github.com/rhettinger/cpython/blob/ffb78c991e6c2d1719e73ae6b9900fe143f97467/Doc/whatsnew/3.7.rst
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/python/cpython/pull/3454/{{ revealButtonHref }}
https://github.com/python/cpython/pull/3454/files#diff-830b405713d1c40982ffa918864e39c40c1b318d79b8dd2b523646dc3bd18b52
serhiy-storchakahttps://github.com/serhiy-storchaka
Sep 9, 2017https://github.com/python/cpython/pull/3454/files#r137932939
Learn morehttps://docs.github.com/articles/managing-disruptive-comments/#hiding-a-comment
Please reload this pagehttps://github.com/python/cpython/pull/3454/files
rhettingerhttps://github.com/rhettinger
Sep 9, 2017https://github.com/python/cpython/pull/3454/files#r137933306
Learn morehttps://docs.github.com/articles/managing-disruptive-comments/#hiding-a-comment
Please reload this pagehttps://github.com/python/cpython/pull/3454/files
serhiy-storchakahttps://github.com/serhiy-storchaka
Sep 9, 2017https://github.com/python/cpython/pull/3454/files#r137932902
Learn morehttps://docs.github.com/articles/managing-disruptive-comments/#hiding-a-comment
Please reload this pagehttps://github.com/python/cpython/pull/3454/files
rhettingerhttps://github.com/rhettinger
Sep 9, 2017https://github.com/python/cpython/pull/3454/files#r137933344
Learn morehttps://docs.github.com/articles/managing-disruptive-comments/#hiding-a-comment
Please reload this pagehttps://github.com/python/cpython/pull/3454/files
methanehttps://github.com/methane
Sep 10, 2017https://github.com/python/cpython/pull/3454/files#r137939162
Learn morehttps://docs.github.com/articles/managing-disruptive-comments/#hiding-a-comment
Please reload this pagehttps://github.com/python/cpython/pull/3454/files
https://github.com/python/cpython/pull/3454/files#diff-830b405713d1c40982ffa918864e39c40c1b318d79b8dd2b523646dc3bd18b52
Lib/collections/__init__.pyhttps://github.com/python/cpython/pull/3454/files#diff-c92f871cb9b4aa1583c89f82cd416d58a5d70fff41faf41e45dedf775dbe7713
View file https://github.com/rhettinger/cpython/blob/ffb78c991e6c2d1719e73ae6b9900fe143f97467/Lib/collections/__init__.py
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/python/cpython/pull/3454/{{ revealButtonHref }}
https://github.com/python/cpython/pull/3454/files#diff-c92f871cb9b4aa1583c89f82cd416d58a5d70fff41faf41e45dedf775dbe7713
https://github.com/python/cpython/pull/3454/files#diff-c92f871cb9b4aa1583c89f82cd416d58a5d70fff41faf41e45dedf775dbe7713
https://github.com/python/cpython/pull/3454/files#diff-c92f871cb9b4aa1583c89f82cd416d58a5d70fff41faf41e45dedf775dbe7713
Please reload this pagehttps://github.com/python/cpython/pull/3454/files
https://github.com/python/cpython/pull/3454/files#diff-c92f871cb9b4aa1583c89f82cd416d58a5d70fff41faf41e45dedf775dbe7713
Lib/test/test_collections.pyhttps://github.com/python/cpython/pull/3454/files#diff-a2a882635e20e8e9439f090d33513502a7af648286efebfa4e4bc37270c44784
View file https://github.com/rhettinger/cpython/blob/ffb78c991e6c2d1719e73ae6b9900fe143f97467/Lib/test/test_collections.py
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/python/cpython/pull/3454/{{ revealButtonHref }}
https://github.com/python/cpython/pull/3454/files#diff-a2a882635e20e8e9439f090d33513502a7af648286efebfa4e4bc37270c44784
https://github.com/python/cpython/pull/3454/files#diff-a2a882635e20e8e9439f090d33513502a7af648286efebfa4e4bc37270c44784
https://github.com/python/cpython/pull/3454/files#diff-a2a882635e20e8e9439f090d33513502a7af648286efebfa4e4bc37270c44784
https://github.com/python/cpython/pull/3454/files#diff-a2a882635e20e8e9439f090d33513502a7af648286efebfa4e4bc37270c44784
https://github.com/python/cpython/pull/3454/files#diff-a2a882635e20e8e9439f090d33513502a7af648286efebfa4e4bc37270c44784
Misc/NEWS.d/next/Library/2017-09-08-14-31-15.bpo-28638.lfbVyH.rsthttps://github.com/python/cpython/pull/3454/files#diff-92c26e6a7507d9b816ef262340ad326ca3d0ea9e531eeecf69108a9d41e7e231
View file https://github.com/rhettinger/cpython/blob/ffb78c991e6c2d1719e73ae6b9900fe143f97467/Misc/NEWS.d/next/Library/2017-09-08-14-31-15.bpo-28638.lfbVyH.rst
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/python/cpython/pull/3454/{{ revealButtonHref }}
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.