René's URL Explorer Experiment


Title: Option to skip per-method docstring generation in build() (memory / high-concurrency) · Issue #2779 · googleapis/google-api-python-client · GitHub

Open Graph Title: Option to skip per-method docstring generation in build() (memory / high-concurrency) · Issue #2779 · googleapis/google-api-python-client

X Title: Option to skip per-method docstring generation in build() (memory / high-concurrency) · Issue #2779 · googleapis/google-api-python-client

Description: Feature request: an option to skip per-method docstring generation in build() Problem build() (and lazy sub-resource construction) generates a fully-expanded, recursively pretty-printed prototype of each method's response schema and atta...

Open Graph Description: Feature request: an option to skip per-method docstring generation in build() Problem build() (and lazy sub-resource construction) generates a fully-expanded, recursively pretty-printed prototype o...

X Description: Feature request: an option to skip per-method docstring generation in build() Problem build() (and lazy sub-resource construction) generates a fully-expanded, recursively pretty-printed prototype o...

Opengraph URL: https://github.com/googleapis/google-api-python-client/issues/2779

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Option to skip per-method docstring generation in build() (memory / high-concurrency)","articleBody":"## Feature request: an option to skip per-method docstring generation in `build()`\n\n### Problem\n\n`build()` (and lazy sub-resource construction) generates a fully-expanded, recursively\npretty-printed prototype of each method's **response schema** and attaches it as\n`method.__doc__` (`discovery.createMethod` → `schema.Schemas.prettyPrintSchema` /\n`prettyPrintByName`). For APIs with large, deeply-nested schemas this is very expensive, and it\nis paid **every time a service/resource is constructed**.\n\nConcrete numbers from profiling Sheets v4 (`google-api-python-client==2.198.0`, Python 3.13),\nmeasured with RSS (no tracemalloc, to avoid its overhead):\n\n- Building the service, then touching one sub-resource (`service.spreadsheets()`, **no API\n  call**): **~66 MB**.\n- Of that, ~99.9% is the docstring schema expansion — no-oping `prettyPrintSchema`/\n  `prettyPrintByName` drops it to **~1 MB**. The `.spreadsheets()` methods themselves are ~24 KB.\n- The docstrings are only useful for interactive `help()`; in a server they are never read.\n\n### Impact\n\nIn a concurrent server (a fresh service built per request, common with per-user credentials),\nthese allocations are **not shared** across in-flight requests. 8 concurrent Sheets requests\neach build ~66 MB of docstrings simultaneously ≈ **530 MB peak**, which OOM-kills a\nmemory-limited container. This is the concurrent-peak sibling of the long-standing\nreference-cycle memory issue in #535 (whose recommended fix — build/reuse a single service — is\nnot always feasible when credentials differ per request).\n\n### Request\n\nA supported way to skip docstring generation at build time, e.g.:\n\n```python\nbuild(\"sheets\", \"v4\", credentials=creds, generate_docstrings=False)\n# or a module/env toggle\n```\n\nToday the only options are to monkeypatch `Schemas.prettyPrintSchema`/`prettyPrintByName`\n(fragile across versions) or fork. A first-class flag would let memory-constrained / high-\nconcurrency deployments opt out of documentation strings they never use.\n\n### Environment\n\n- `google-api-python-client==2.198.0`, Python 3.13\n- Reproly: build any large-schema API (Sheets v4), touch a sub-resource, measure RSS; repeat\n  concurrently to see the multiplier.\n\nRelated: #535 (memory from repeated `build()` / reference cycles).\n","author":{"url":"https://github.com/walkingpendulum","@type":"Person","name":"walkingpendulum"},"datePublished":"2026-07-21T18:18:34Z","url":"https://github.com/googleapis/google-api-python-client/issues/2779"}

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/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:4a7f253f-7ca0-ee4a-b095-c1720eabca76
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idE572:21149E:58B0F8:7A15E4:6B00934C
html-safe-noncee0c5372a239e516dc8a8083b3baf4b38cd8966edff1efe8c714acaaace3ae169
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFNTcyOjIxMTQ5RTo1OEIwRjg6N0ExNUU0OjZCMDA5MzRDIiwidmlzaXRvcl9pZCI6IjM1Nzk4ODYzNTQ3MzEyMjEyNCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmac500caf2a87071e8583eedcaf18443dabaaea497fcdf1ba80acc4003e9613066d
hovercard-subject-tagissue:4941857464
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/googleapis/google-api-python-client/2779/issue_layout
twitter:imagehttps://opengraph.githubassets.com/d5cbf9645e9f50027ab130e88aa4b3e0cdfb551edd8135200dc6c020004d0e63/googleapis/google-api-python-client/issues/2779
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/d5cbf9645e9f50027ab130e88aa4b3e0cdfb551edd8135200dc6c020004d0e63/googleapis/google-api-python-client/issues/2779
og:image:altFeature request: an option to skip per-method docstring generation in build() Problem build() (and lazy sub-resource construction) generates a fully-expanded, recursively pretty-printed prototype o...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernamewalkingpendulum
hostnamegithub.com
expected-hostnamegithub.com
Nonec710a5cb5c47be60abfe6e8410436d409906979dbed614ef09f29c60f5535b08
turbo-cache-controlno-preview
go-importgithub.com/googleapis/google-api-python-client git https://github.com/googleapis/google-api-python-client.git
octolytics-dimension-user_id16785467
octolytics-dimension-user_logingoogleapis
octolytics-dimension-repository_id15749269
octolytics-dimension-repository_nwogoogleapis/google-api-python-client
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id15749269
octolytics-dimension-repository_network_root_nwogoogleapis/google-api-python-client
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
releasebe616a2a6ec1c609d6e002896dff5352d5c5f28b
ui-targetfull
theme-color#1e2327
color-schemelight dark
react-app-nameissues

Links:

Skip to contenthttps://github.com/googleapis/google-api-python-client/issues/2779#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fgoogleapis%2Fgoogle-api-python-client%2Fissues%2F2779
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%2Fgoogleapis%2Fgoogle-api-python-client%2Fissues%2F2779
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%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=googleapis%2Fgoogle-api-python-client
Reloadhttps://github.com/googleapis/google-api-python-client/issues/2779
Reloadhttps://github.com/googleapis/google-api-python-client/issues/2779
Reloadhttps://github.com/googleapis/google-api-python-client/issues/2779
googleapishttps://github.com/googleapis
google-api-python-clienthttps://github.com/googleapis/google-api-python-client
Codehttps://github.com/googleapis/google-api-python-client
Issues18 (18)https://github.com/googleapis/google-api-python-client/issues
Pull requests39 (39)https://github.com/googleapis/google-api-python-client/pulls
Discussionshttps://github.com/googleapis/google-api-python-client/discussions
Actionshttps://github.com/googleapis/google-api-python-client/actions
Projectshttps://github.com/googleapis/google-api-python-client/projects
Security and qualityhttps://github.com/googleapis/google-api-python-client/security
Insightshttps://github.com/googleapis/google-api-python-client/insights
https://github.com/googleapis/google-api-python-client
New issuehttps://github.com/login?return_to=https://github.com/googleapis/google-api-python-client/issues/2779
New issuehttps://github.com/login?return_to=https://github.com/googleapis/google-api-python-client/issues/2779
#2822https://github.com/googleapis/google-api-python-client/pull/2822
Option to skip per-method docstring generation in build() (memory / high-concurrency)https://github.com/googleapis/google-api-python-client/issues/2779#top
#2822https://github.com/googleapis/google-api-python-client/pull/2822
priority: p3Desirable enhancement or fix. May not be included in next release.https://github.com/googleapis/google-api-python-client/issues?q=state%3Aopen%20label%3A%22priority%3A%20p3%22
type: feature request‘Nice-to-have’ improvement, new feature or different behavior or design.https://github.com/googleapis/google-api-python-client/issues?q=state%3Aopen%20label%3A%22type%3A%20feature%20request%22
https://github.com/walkingpendulum
walkingpendulumhttps://github.com/walkingpendulum
on Jul 21, 2026https://github.com/googleapis/google-api-python-client/issues/2779#issue-4941857464
#535https://github.com/googleapis/google-api-python-client/issues/535
#535https://github.com/googleapis/google-api-python-client/issues/535
daniel-sanchehttps://github.com/daniel-sanche
type: feature request‘Nice-to-have’ improvement, new feature or different behavior or design.https://github.com/googleapis/google-api-python-client/issues?q=state%3Aopen%20label%3A%22type%3A%20feature%20request%22
priority: p3Desirable enhancement or fix. May not be included in next release.https://github.com/googleapis/google-api-python-client/issues?q=state%3Aopen%20label%3A%22priority%3A%20p3%22
on Nov 6, 2026https://github.com/googleapis/google-api-python-client/issues/2779#event-35396604553
Sign up for freehttps://github.com/signup?return_to=https://github.com/googleapis/google-api-python-client/issues/2779
Sign in to commenthttps://github.com/login?return_to=https://github.com/googleapis/google-api-python-client/issues/2779
priority: p3Desirable enhancement or fix. May not be included in next release.https://github.com/googleapis/google-api-python-client/issues?q=state%3Aopen%20label%3A%22priority%3A%20p3%22
type: feature request‘Nice-to-have’ improvement, new feature or different behavior or design.https://github.com/googleapis/google-api-python-client/issues?q=state%3Aopen%20label%3A%22type%3A%20feature%20request%22
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.