René's URL Explorer Experiment


Title: Lazy-load top-level imports and defer setup by cvanelteren · Pull Request #439 · Ultraplot/UltraPlot · GitHub

Open Graph Title: Lazy-load top-level imports and defer setup by cvanelteren · Pull Request #439 · Ultraplot/UltraPlot

X Title: Lazy-load top-level imports and defer setup by cvanelteren · Pull Request #439 · Ultraplot/UltraPlot

Description: This PR rewires ultraplot’s import path to lazy‑load modules/registries and defer setup/registration work until first access, moves docstring snippet setup into ultraplot.internals.docstring with lazy snippet resolution, and defers optional dependency imports (IPython/pyplot/cartopy/basemap) while preserving the public API. Import time report (python -X importtime -c "import ultraplot", Python 3.13.11): Logs: import_before_lazy.log, import_after_lazy.log Total before: 838.4 ms Total after: 12.2 ms Delta: -826.2 ms (~98.5% reduction) Top ultraplot modules (before): 838.4 ms | 49.4 ms | ultraplot 408.8 ms | 0.6 ms | ultraplot.internals 289.4 ms | 7.7 ms | ultraplot.config 209.5 ms | 0.4 ms | ultraplot.internals.docstring 51.3 ms | 0.6 ms | ultraplot.axes 29.9 ms | 14.6 ms | ultraplot.axes.cartesian 15.0 ms | 14.8 ms | ultraplot.axes.plot 8.6 ms | 6.2 ms | ultraplot.axes.base 6.7 ms | 6.5 ms | ultraplot.axes.geo 5.8 ms | 5.8 ms | ultraplot.scale 3.7 ms | 3.7 ms | ultraplot.figure 3.4 ms | 3.4 ms | ultraplot.axes.polar Top external modules (before): 281.7 ms | 0.3 ms | IPython 211.0 ms | 2.1 ms | IPython.terminal.embed 158.4 ms | 0.3 ms | matplotlib.axes 126.9 ms | 2.3 ms | IPython.terminal.interactiveshell 118.3 ms | 5.2 ms | matplotlib.axes._base 114.9 ms | 7.4 ms | matplotlib 95.1 ms | 6.5 ms | matplotlib.offsetbox 69.8 ms | 1.1 ms | IPython.core.application 64.4 ms | 0.7 ms | IPython.terminal.debugger 60.5 ms | 1.6 ms | numpy 60.5 ms | 1.0 ms | matplotlib.rcsetup 58.9 ms | 4.8 ms | IPython.core.completer Top ultraplot modules (after): 12.2 ms | 0.2 ms | ultraplot 0.2 ms | 0.2 ms | ultraplot._version Top external modules (after): 8.2 ms | 1.1 ms | ast 5.7 ms | 0.5 ms | re 5.3 ms | 1.6 ms | site 3.6 ms | 1.2 ms | enum 3.5 ms | 0.2 ms | pathlib 2.5 ms | 0.5 ms | functools 1.9 ms | 1.0 ms | collections 1.8 ms | 0.6 ms | pathlib._local 1.6 ms | 0.4 ms | os 1.4 ms | 0.5 ms | pathlib._abc 1.4 ms | 0.3 ms | re._compiler 1.3 ms | 0.5 ms | encodings Closes #395

Open Graph Description: This PR rewires ultraplot’s import path to lazy‑load modules/registries and defer setup/registration work until first access, moves docstring snippet setup into ultraplot.internals.docstring with l...

X Description: This PR rewires ultraplot’s import path to lazy‑load modules/registries and defer setup/registration work until first access, moves docstring snippet setup into ultraplot.internals.docstring with l...

Opengraph URL: https://github.com/Ultraplot/UltraPlot/pull/439

X: @github

direct link

Domain: github.com

route-pattern/:user_id/:repository/pull/:id/commits/:range(.:format)
route-controllerpull_requests
route-actioncommits
fetch-noncev2:6ee20d90-adea-1476-258f-1832eaec8c9e
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-id9B3C:184148:618C0:864CF:69976BF2
html-safe-nonce36d563da4594efd5cd502e4e6b810a06d7dbbcabbbfed9b09bee89be85a4fb42
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5QjNDOjE4NDE0ODo2MThDMDo4NjRDRjo2OTk3NkJGMiIsInZpc2l0b3JfaWQiOiI0ODA0OTE5MDk0MjIxOTU4MTMwIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0=
visitor-hmac3dc2b6cad69c671f6e95680a824fd07355f276a941ab2d913842854f3a4827d3
hovercard-subject-tagpull_request:3135888052
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/commits
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/Ultraplot/UltraPlot/pull/439/commits/c7ad117a3579743fea1e51b6464609239a5e8909
twitter:imagehttps://avatars.githubusercontent.com/u/19485143?s=400&v=4
twitter:cardsummary_large_image
og:imagehttps://avatars.githubusercontent.com/u/19485143?s=400&v=4
og:image:altThis PR rewires ultraplot’s import path to lazy‑load modules/registries and defer setup/registration work until first access, moves docstring snippet setup into ultraplot.internals.docstring with l...
og:site_nameGitHub
og:typeobject
hostnamegithub.com
expected-hostnamegithub.com
None3f6df5422af98e8455c055522f48ada1a19fab299cf47471bdd590f8b7291770
turbo-cache-controlno-preview
diff-viewunified
go-importgithub.com/Ultraplot/UltraPlot git https://github.com/Ultraplot/UltraPlot.git
octolytics-dimension-user_id193136251
octolytics-dimension-user_loginUltraplot
octolytics-dimension-repository_id909651179
octolytics-dimension-repository_nwoUltraplot/UltraPlot
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id909651179
octolytics-dimension-repository_network_root_nwoUltraplot/UltraPlot
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
release9b5cbb0725d622d54f9a26cbf0adbfbe35459c44
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/Ultraplot/UltraPlot/pull/439/commits/c7ad117a3579743fea1e51b6464609239a5e8909#start-of-content
https://github.com/
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2FUltraplot%2FUltraPlot%2Fpull%2F439%2Fcommits%2Fc7ad117a3579743fea1e51b6464609239a5e8909
GitHub CopilotWrite better code with AIhttps://github.com/features/copilot
GitHub SparkBuild and deploy intelligent appshttps://github.com/features/spark
GitHub ModelsManage and compare promptshttps://github.com/features/models
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
GitHub SponsorsFund open source developershttps://github.com/sponsors
Security Labhttps://securitylab.github.com
Maintainer Communityhttps://maintainers.github.com
Acceleratorhttps://github.com/accelerator
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/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%2FUltraplot%2FUltraPlot%2Fpull%2F439%2Fcommits%2Fc7ad117a3579743fea1e51b6464609239a5e8909
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%2Fcommits&source=header-repo&source_repo=Ultraplot%2FUltraPlot
Reloadhttps://github.com/Ultraplot/UltraPlot/pull/439/commits/c7ad117a3579743fea1e51b6464609239a5e8909
Reloadhttps://github.com/Ultraplot/UltraPlot/pull/439/commits/c7ad117a3579743fea1e51b6464609239a5e8909
Reloadhttps://github.com/Ultraplot/UltraPlot/pull/439/commits/c7ad117a3579743fea1e51b6464609239a5e8909
Ultraplot https://github.com/Ultraplot
UltraPlothttps://github.com/Ultraplot/UltraPlot
Notifications https://github.com/login?return_to=%2FUltraplot%2FUltraPlot
Fork 18 https://github.com/login?return_to=%2FUltraplot%2FUltraPlot
Star 271 https://github.com/login?return_to=%2FUltraplot%2FUltraPlot
Code https://github.com/Ultraplot/UltraPlot
Issues 7 https://github.com/Ultraplot/UltraPlot/issues
Pull requests 3 https://github.com/Ultraplot/UltraPlot/pulls
Discussions https://github.com/Ultraplot/UltraPlot/discussions
Actions https://github.com/Ultraplot/UltraPlot/actions
Projects 0 https://github.com/Ultraplot/UltraPlot/projects
Wiki https://github.com/Ultraplot/UltraPlot/wiki
Security 0 https://github.com/Ultraplot/UltraPlot/security
Insights https://github.com/Ultraplot/UltraPlot/pulse
Code https://github.com/Ultraplot/UltraPlot
Issues https://github.com/Ultraplot/UltraPlot/issues
Pull requests https://github.com/Ultraplot/UltraPlot/pulls
Discussions https://github.com/Ultraplot/UltraPlot/discussions
Actions https://github.com/Ultraplot/UltraPlot/actions
Projects https://github.com/Ultraplot/UltraPlot/projects
Wiki https://github.com/Ultraplot/UltraPlot/wiki
Security https://github.com/Ultraplot/UltraPlot/security
Insights https://github.com/Ultraplot/UltraPlot/pulse
Sign up for GitHub https://github.com/signup?return_to=%2FUltraplot%2FUltraPlot%2Fissues%2Fnew%2Fchoose
terms of servicehttps://docs.github.com/terms
privacy statementhttps://docs.github.com/privacy
Sign inhttps://github.com/login?return_to=%2FUltraplot%2FUltraPlot%2Fissues%2Fnew%2Fchoose
cvanelterenhttps://github.com/cvanelteren
Ultraplot:mainhttps://github.com/Ultraplot/UltraPlot/tree/main
cvanelteren:lazy-imports-perfhttps://github.com/cvanelteren/ultraplot/tree/lazy-imports-perf
Conversation 13 https://github.com/Ultraplot/UltraPlot/pull/439
Commits 27 https://github.com/Ultraplot/UltraPlot/pull/439/commits
Checks 23 https://github.com/Ultraplot/UltraPlot/pull/439/checks
Files changed https://github.com/Ultraplot/UltraPlot/pull/439/files
Please reload this pagehttps://github.com/Ultraplot/UltraPlot/pull/439/commits/c7ad117a3579743fea1e51b6464609239a5e8909
Lazy-load top-level imports and defer setup https://github.com/Ultraplot/UltraPlot/pull/439/commits/c7ad117a3579743fea1e51b6464609239a5e8909#top
Show all changes 27 commits https://github.com/Ultraplot/UltraPlot/pull/439/files
f47fdc7 Lazy-load top-level imports cvanelteren Dec 30, 2025 https://github.com/Ultraplot/UltraPlot/pull/439/commits/f47fdc794e761a2104b5351302af295a1fcb89ab
5744830 Use warnings module in internals cvanelteren Dec 30, 2025 https://github.com/Ultraplot/UltraPlot/pull/439/commits/574483051eb05296c1218d5f14f06f46f6230a5a
eafd077 Add eager import option and tests cvanelteren Dec 30, 2025 https://github.com/Ultraplot/UltraPlot/pull/439/commits/eafd07701f66c69cfbb2125d230d03806dfa9a00
d785584 Cover eager setup and benchmark imports cvanelteren Dec 30, 2025 https://github.com/Ultraplot/UltraPlot/pull/439/commits/d785584f7c6150b7bb5fc73bbbb9d35b164598c5
7ea91e6 Add tests for lazy import coverage cvanelteren Dec 30, 2025 https://github.com/Ultraplot/UltraPlot/pull/439/commits/7ea91e6227e82fd0e83a3d0bfad10b389da1fb0c
9731ff1 update docs cvanelteren Jan 4, 2026 https://github.com/Ultraplot/UltraPlot/pull/439/commits/9731ff181649aa49b636d8decf12163dcc28f437
23cd51d Merge branch 'main' into lazy-imports-perf cvanelteren Jan 4, 2026 https://github.com/Ultraplot/UltraPlot/pull/439/commits/23cd51da0a7f103e02d7d0445cc55544d7df1cd3
7de24b3 refactor: Automate lazy loading and fix build error cvanelteren Jan 4, 2026 https://github.com/Ultraplot/UltraPlot/pull/439/commits/7de24b32206f9b705cbad1dda5f3fdf2f66ac0ef
b1a2155 update instructions cvanelteren Jan 4, 2026 https://github.com/Ultraplot/UltraPlot/pull/439/commits/b1a215550ad91c47dd18506f49aebc7478a013ea
05cf17a fix issues cvanelteren Jan 4, 2026 https://github.com/Ultraplot/UltraPlot/pull/439/commits/05cf17a62626558c28a6e7d3f6f10670add91d22
94bcf34 attempt fix cvanelteren Jan 4, 2026 https://github.com/Ultraplot/UltraPlot/pull/439/commits/94bcf34fb6d5de03779809b4261cf232adcb3f45
b0a06d5 attempt fix cvanelteren Jan 4, 2026 https://github.com/Ultraplot/UltraPlot/pull/439/commits/b0a06d5d2d8da2b8399865716d0a9c9ea9ed10b6
134f4a1 Fix lazy import clobbering figure cvanelteren Jan 4, 2026 https://github.com/Ultraplot/UltraPlot/pull/439/commits/134f4a1e019fae1eda7c83d2f0cd6fdf8c7c2c30
2abb008 Add regression test for figure lazy import cvanelteren Jan 4, 2026 https://github.com/Ultraplot/UltraPlot/pull/439/commits/2abb008fb8ac43eb5b2a073f815bb56ecafd31f6
ebb37ab fixed cvanelteren Jan 4, 2026 https://github.com/Ultraplot/UltraPlot/pull/439/commits/ebb37abb7a9bde0ea3d7ccf20ef6650859caff37
7fb309e Refactor lazy loader into helper module cvanelteren Jan 4, 2026 https://github.com/Ultraplot/UltraPlot/pull/439/commits/7fb309e4504ee83aff96226362470ef3df632603
bd61a35 bump cvanelteren Jan 4, 2026 https://github.com/Ultraplot/UltraPlot/pull/439/commits/bd61a350bbadab0fdabaef0e187e2e51dd1d793e
d15e1a9 bump cvanelteren Jan 5, 2026 https://github.com/Ultraplot/UltraPlot/pull/439/commits/d15e1a9be287e89c685cc8a26d57a3c3f40edc83
a87dcf0 resolve namespace collision cvanelteren Jan 5, 2026 https://github.com/Ultraplot/UltraPlot/pull/439/commits/a87dcf0d48f6d2110658a3d3e2e222fc868c2180
9c99e3d resolve namespace collision cvanelteren Jan 5, 2026 https://github.com/Ultraplot/UltraPlot/pull/439/commits/9c99e3d4aa8b2f77f183c3ba2180e6b59799d1f3
6a0c775 Merge branch 'main' into lazy-imports-perf cvanelteren Jan 6, 2026 https://github.com/Ultraplot/UltraPlot/pull/439/commits/6a0c77546c5009a7e8c593212eb9c5df4ebbf06c
93dda9f Merge branch 'main' into lazy-imports-perf cvanelteren Jan 8, 2026 https://github.com/Ultraplot/UltraPlot/pull/439/commits/93dda9f0ba13f2e4cda6d932a5fd0ab311d28819
c1f3e2c Merge branch 'main' into lazy-imports-perf cvanelteren Jan 11, 2026 https://github.com/Ultraplot/UltraPlot/pull/439/commits/c1f3e2c94270638dcbf31616bf2ee4768867f795
4bf18c9 Merge branch 'main' into lazy-imports-perf cvanelteren Jan 11, 2026 https://github.com/Ultraplot/UltraPlot/pull/439/commits/4bf18c95b5f3c8985ca8bb4afcab1e24bd75a406
a307ef9 mv docs cvanelteren Jan 8, 2026 https://github.com/Ultraplot/UltraPlot/pull/439/commits/a307ef991f93eaa8184c6c079653c87114276b75
c7ad117 Update lazy-loading contributor docs cvanelteren Jan 15, 2026 https://github.com/Ultraplot/UltraPlot/pull/439/commits/c7ad117a3579743fea1e51b6464609239a5e8909
edbb90b Merge branch 'main' into lazy-imports-perf cvanelteren Jan 15, 2026 https://github.com/Ultraplot/UltraPlot/pull/439/commits/edbb90b294bee4a70220449bbb50030c74fb766d
Clear filters https://github.com/Ultraplot/UltraPlot/pull/439/commits/c7ad117a3579743fea1e51b6464609239a5e8909
Please reload this pagehttps://github.com/Ultraplot/UltraPlot/pull/439/commits/c7ad117a3579743fea1e51b6464609239a5e8909
Please reload this pagehttps://github.com/Ultraplot/UltraPlot/pull/439/commits/c7ad117a3579743fea1e51b6464609239a5e8909
Prev https://github.com/Ultraplot/UltraPlot/pull/439/commits/a307ef991f93eaa8184c6c079653c87114276b75
Next https://github.com/Ultraplot/UltraPlot/pull/439/commits/edbb90b294bee4a70220449bbb50030c74fb766d
Please reload this pagehttps://github.com/Ultraplot/UltraPlot/pull/439/commits/c7ad117a3579743fea1e51b6464609239a5e8909
https://github.com/cvanelteren
cvanelterenhttps://github.com/Ultraplot/UltraPlot/commits?author=cvanelteren
docs/contributing.rsthttps://github.com/Ultraplot/UltraPlot/pull/439/commits/c7ad117a3579743fea1e51b6464609239a5e8909#diff-e052d37005ef738791e533f325afeb1f194d5d2c18e5cb0cd992ca56097baba0
View file https://github.com/cvanelteren/ultraplot/blob/c7ad117a3579743fea1e51b6464609239a5e8909/docs/contributing.rst
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/Ultraplot/UltraPlot/pull/439/commits/{{ revealButtonHref }}
https://github.com/Ultraplot/UltraPlot/pull/439/commits/c7ad117a3579743fea1e51b6464609239a5e8909#diff-e052d37005ef738791e533f325afeb1f194d5d2c18e5cb0cd992ca56097baba0
https://github.com/Ultraplot/UltraPlot/pull/439/commits/c7ad117a3579743fea1e51b6464609239a5e8909#diff-e052d37005ef738791e533f325afeb1f194d5d2c18e5cb0cd992ca56097baba0
https://github.com/Ultraplot/UltraPlot/pull/439/commits/c7ad117a3579743fea1e51b6464609239a5e8909#diff-e052d37005ef738791e533f325afeb1f194d5d2c18e5cb0cd992ca56097baba0
https://github.com/Ultraplot/UltraPlot/pull/439/commits/c7ad117a3579743fea1e51b6464609239a5e8909#diff-e052d37005ef738791e533f325afeb1f194d5d2c18e5cb0cd992ca56097baba0
Please reload this pagehttps://github.com/Ultraplot/UltraPlot/pull/439/commits/c7ad117a3579743fea1e51b6464609239a5e8909
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.