René's URL Explorer Experiment


Title: gh-144384: Improve `_colorize` performance by replacing `dataclass` with regular class by hugovk · Pull Request #144879 · python/cpython · GitHub

Open Graph Title: gh-144384: Improve `_colorize` performance by replacing `dataclass` with regular class by hugovk · Pull Request #144879 · python/cpython

X Title: gh-144384: Improve `_colorize` performance by replacing `dataclass` with regular class by hugovk · Pull Request #144879 · python/cpython

Description: The Python programming language. Contribute to python/cpython development by creating an account on GitHub.

Open Graph Description: _colorize constructs six different theme classes (and I expect more in the future), which are slow to build because they use dataclasses. This makes the module as a whole slow to import, even the i...

X Description: _colorize constructs six different theme classes (and I expect more in the future), which are slow to build because they use dataclasses. This makes the module as a whole slow to import, even the i...

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

X: @github

direct link

Domain: github.com

react-profiling0
react-import-mapreact,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322
route-pattern/_view_fragments/voltron/pull_requests/show/:user_id/:repository/:id/pull_request_layout(.:format)
route-controllervoltron_pull_requests_fragments
route-actionpull_request_layout
fetch-noncev2:f780fd3d-0920-b0fa-e2a4-5f29cd2f03b6
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-id85A8:20AA01:3FF56EF:512A014:6B020558
html-safe-noncec5d27fa5e6d8de30e339b2c3b8036dc9d1287453908a02af5908d65ddc8299a2
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4NUE4OjIwQUEwMTozRkY1NkVGOjUxMkEwMTQ6NkIwMjA1NTgiLCJ2aXNpdG9yX2lkIjoiMjY4NTU3ODMyNjgyNjk0MzgzMiIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmacaa0bd4692a67bc2a3acf9853945c42cd65aaf1476f64b5a945b165c08b4885ef
hovercard-subject-tagpull_request:3290394938
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///voltron/pull_requests_fragments/pull_request_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/voltron/pull_requests/show/python/cpython/144879/pull_request_layout
twitter:imagehttps://opengraph.githubassets.com/0592b6eaf96811d639596a359b63867c0861552b653097d476c30e6e7aac0b3f/python/cpython/pull/144879
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/0592b6eaf96811d639596a359b63867c0861552b653097d476c30e6e7aac0b3f/python/cpython/pull/144879
og:image:alt_colorize constructs six different theme classes (and I expect more in the future), which are slow to build because they use dataclasses. This makes the module as a whole slow to import, even the i...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernamehugovk
hostnamegithub.com
expected-hostnamegithub.com
None87e774ee7c6b3bee0490394e4d3e57ec9dbc956f74b87ea685dc8996c1676456
turbo-cache-controlno-cache
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
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release423dbb54c5e7bfecc838eb387c1435eb3d0e760d
ui-targetfull
theme-color#1e2327
color-schemelight dark
react-app-namepull-requests

Links:

Skip to contenthttps://github.com/python/cpython/pull/144879#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpython%2Fcpython%2Fpull%2F144879
GitHubRepository hosting, code review, and collaborationhttps://github.com/platform
CopilotAI coding agent for tasks, projects, and automated workhttps://github.com/features/copilot
ActionsCI/CD and automationhttps://github.com/features/actions
Code QualityQuality analysis, fixes, and enforcementhttps://github.com/features/code-quality
CodespacesCloud development environmentshttps://github.com/features/codespaces
Code SecurityVulnerability detection and remediationhttps://github.com/security/advanced-security/code-security
Secret ProtectionSecret scanning and leak preventionhttps://github.com/security/advanced-security/secret-protection
All Featureshttps://github.com/features
Documentationhttps://docs.github.com/en
Traininghttps://learn.github.com/skills
Certificationshttps://learn.github.com/credentials
Build with Copilothttps://github.com/features/ai
Customize Copilothttps://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-copilot-overview
Integrationshttps://github.com/marketplace
Trending reposhttps://github.com/trending
GitHub Sponsorshttps://github.com/open-source/sponsors
Developer articleshttps://github.com/resources/articles
ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place.https://github.blog/changelog/
Enterpriseshttps://github.com/enterprise
Teamhttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
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
See all industrieshttps://github.com/solutions/industry
Why GitHubhttps://github.com/why-github
Customer Storieshttps://github.com/customer-stories
Business insightshttps://github.com/solutions/executive-insights
Trust Centerhttps://github.com/trust-center
GitHub Advanced SecurityEnterprise-grade code securityhttps://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
Documentationhttps://docs.github.com/en
Resource centerhttps://github.com/resources
Bloghttps://github.blog/
Events & webinarshttps://github.com/resources/events
Community Forumhttps://github.com/orgs/community/discussions
Customer Storieshttps://github.com/customer-stories
Integrationshttps://github.com/marketplace
Customer supporthttps://help.github.com/
Traininghttps://learn.github.com/skills
GitHub Statushttps://www.githubstatus.com/
Abouthttps://github.com/about
Partnershttps://github.com/partners
Changeloghttps://github.blog/changelog/
GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub.https://githubuniverse.com/
Pricinghttps://github.com/pricing
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpython%2Fcpython%2Fpull%2F144879
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fpull_requests_fragments%2Fpull_request_layout&source=header-repo&source_repo=python%2Fcpython
Reloadhttps://github.com/python/cpython/pull/144879
Reloadhttps://github.com/python/cpython/pull/144879
Reloadhttps://github.com/python/cpython/pull/144879
pythonhttps://github.com/python
cpythonhttps://github.com/python/cpython
Codehttps://github.com/python/cpython
Issues5k+ (5k+)https://github.com/python/cpython/issues
Pull requests2.4k (2.4k)https://github.com/python/cpython/pulls
Actionshttps://github.com/python/cpython/actions
Projectshttps://github.com/python/cpython/projects
Security and qualityhttps://github.com/python/cpython/security
Insightshttps://github.com/python/cpython/insights
https://github.com/python/cpython
hugovkhttps://github.com/hugovk
python:mainhttps://github.com/python/cpython/tree/main
hugovk:3.15-colorize-performancehttps://github.com/hugovk/cpython/tree/3.15-colorize-performance
Conversationhttps://github.com/python/cpython/pull/144879
Commits2 (2)https://github.com/python/cpython/pull/144879/commits
Checkshttps://github.com/python/cpython/pull/144879/checks
Files changedhttps://github.com/python/cpython/pull/144879/files
gh-144384: Improve _colorize performance by replacing dataclass with regular classhttps://github.com/python/cpython/pull/144879#top
hugovkhttps://github.com/hugovk
python:mainhttps://github.com/python/cpython/tree/main
hugovk:3.15-colorize-performancehttps://github.com/hugovk/cpython/tree/3.15-colorize-performance
https://github.com/hugovk
hugovkhttps://github.com/hugovk
Feb 16, 2026https://github.com/python/cpython/pull/144879#issue-3948221292
Please reload this pagehttps://github.com/python/cpython/pull/144879
https://private-user-images.githubusercontent.com/1324225/550466599-5dba1dde-dbe8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yMjk5MTZkZTZkODUyMDU1NjJkYTM5ODY3YmJhNGJjMSZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QmcmVzcG9uc2UtY29udGVudC10eXBlPWltYWdlJTJGcG5nIn0.g3m1YTH9wNN38u4UzkIoGuIRN_zyXMF3ZH1dyhKqwpM
https://private-user-images.githubusercontent.com/1324225/550467049-87655977-d9fa-437d-9e08-55d9da64cc93.png?jwt=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3OTUyOTQ4NTIsIm5iZiI6MTc5NTI5NDU1MiwicGF0aCI6Ii8xMzI0MjI1LzU1MDQ2NzA0OS04NzY1NTk3Ny1kOWZhLTQzN2QtOWUwOC01NWQ5ZGE2NGNjOTMucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI2MTEyMSUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNjExMjFUMjA1NTUyWiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9MGVjYzYwMDYxMDU3ZjM0MGNhOTk2ZjdmYWU0MGFmNDk5Mjg2NzVjMDEzMzFkNDViMzgyYmUzODgzYjMzMTJlOSZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QmcmVzcG9uc2UtY29udGVudC10eXBlPWltYWdlJTJGcG5nIn0.Jxh7cwb58AwCyNV5Ra71wm8RDTZCVluIwiu9SFYQK1I
_colorize module is slow to import, affecting traceback and logging modules #144384https://github.com/python/cpython/issues/144384
Please reload this pagehttps://github.com/python/cpython/pull/144879
https://github.com/hugovk
Improve _colorize performance by replacing dataclass with regular classhttps://github.com/python/cpython/pull/144879/commits/8b5535dba493b4f2f351c80bc95adc7de26dc87d
8b5535dhttps://github.com/python/cpython/pull/144879/commits/8b5535dba493b4f2f351c80bc95adc7de26dc87d
https://github.com/apps/bedevere-app
bedevere-apphttps://github.com/apps/bedevere-app
awaiting core review https://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22awaiting%20core%20review%22
Feb 16, 2026https://github.com/python/cpython/pull/144879#event-22828080203
https://github.com/apps/bedevere-app
bedevere-apphttps://github.com/apps/bedevere-app
Feb 16, 2026 https://github.com/python/cpython/pull/144879#ref-issue-3883386667
_colorize module is slow to import, affecting traceback and logging modules #144384 https://github.com/python/cpython/issues/144384
https://github.com/hugovk
Fix mypyhttps://github.com/python/cpython/pull/144879/commits/3159ab7f3d772a7072b3849d3cf0574a4e58774d
3159ab7https://github.com/python/cpython/pull/144879/commits/3159ab7f3d772a7072b3849d3cf0574a4e58774d
https://github.com/ambv
ambvhttps://github.com/ambv
DO-NOT-MERGE https://github.com/python/cpython/issues?q=state%3Aopen%20label%3ADO-NOT-MERGE
Feb 16, 2026https://github.com/python/cpython/pull/144879#event-22829755322
https://github.com/ambv
ambvhttps://github.com/ambv
Feb 16, 2026https://github.com/python/cpython/pull/144879#issuecomment-3909316150
Please reload this pagehttps://github.com/python/cpython/pull/144879
https://github.com/hugovk
hugovkhttps://github.com/hugovk
Mar 21, 2026https://github.com/python/cpython/pull/144879#issuecomment-4103414191
Please reload this pagehttps://github.com/python/cpython/pull/144879
https://github.com/hugovk
hugovkhttps://github.com/hugovk
Mar 21, 2026https://github.com/python/cpython/pull/144879#event-23777280000
https://github.com/hugovk
hugovkhttps://github.com/hugovk
March 21, 2026 14:09https://github.com/python/cpython/pull/144879#event-23777280521
https://github.co/hiddenchars
https://github.com/python/cpython/pull/{{ revealButtonHref }}
Sign up for freehttps://github.com/join?source=comment-repo
Sign in to commenthttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpython%2Fcpython%2Fpull%2F144879
Please reload this pagehttps://github.com/python/cpython/pull/144879
awaiting core review https://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22awaiting%20core%20review%22
DO-NOT-MERGE https://github.com/python/cpython/issues?q=state%3Aopen%20label%3ADO-NOT-MERGE
Please reload this pagehttps://github.com/python/cpython/pull/144879
https://github.com/hugovk
https://github.com/ambv
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.