René's URL Explorer Experiment


Title: Speed up float encoding in `json` · Issue #159702 · python/cpython · GitHub

Open Graph Title: Speed up float encoding in `json` · Issue #159702 · python/cpython

X Title: Speed up float encoding in `json` · Issue #159702 · python/cpython

Description: Feature or enhancement I ran a throughput benchmark for different json libraries. Float encoding is a particularly weak area for the json library, especially for large-magnitude floats. Would it be possible to optimize this by adding a s...

Open Graph Description: Feature or enhancement I ran a throughput benchmark for different json libraries. Float encoding is a particularly weak area for the json library, especially for large-magnitude floats. Would it be...

X Description: Feature or enhancement I ran a throughput benchmark for different json libraries. Float encoding is a particularly weak area for the json library, especially for large-magnitude floats. Would it be...

Opengraph URL: https://github.com/python/cpython/issues/159702

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Speed up float encoding in `json`","articleBody":"### Feature or enhancement\n\nI ran a [throughput benchmark](https://jsonyx.readthedocs.io/en/latest/benchmark.html) for different json libraries.\n\nFloat encoding is a particularly weak area for the `json` library, especially for large-magnitude floats. Would it be possible to optimize this by adding a special case to `PyUnicodeWriter_WriteRepr()`, similar to `_PyLong_FormatWriter()` for integers?\n\n| encode                    |   json | jsonyx | fastsimdjson | msgspec |   orjson | fastest time |\n|:--------------------------|-------:|-------:|-------------:|--------:|---------:|-------------:|\n| `0.0`                     | 12.68x | 14.10x |        1.32x |   1.00x |    1.11x |      7.32 ns |\n| `1e-05`                   | 13.05x | 13.47x |        1.12x |   1.81x |    1.00x |     29.43 ns |\n| `5e-324`                  | 25.71x | 26.07x |        1.07x |   1.00x |    1.33x |     24.83 ns |\n| `1.7976931348623157e+308` | 79.89x | 80.30x |        1.00x |   1.28x |    1.03x |     30.29 ns |\n\ncc @vstinner\n\n### Has this already been discussed elsewhere?\n\nThis is a minor feature, which does not need previous discussion elsewhere\n\n### Links to previous discussion of this feature:\n\n_No response_\n\n\u003c!-- gh-linked-prs -->\n### Linked PRs\n* gh-159826\n\u003c!-- /gh-linked-prs -->\n","author":{"url":"https://github.com/nineteendo","@type":"Person","name":"nineteendo"},"datePublished":"2026-10-19T10:59:56Z","url":"https://github.com/python/cpython/issues/159702"}

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:ababc709-644d-e057-22ff-626f36ec7d87
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idAE6A:19B6A2:1308351:192CE9B:6B01EDFA
html-safe-nonce0a77caaf60607cdaf700ae1674151d2ea27977102ea901162ebcabb78c293285
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBRTZBOjE5QjZBMjoxMzA4MzUxOjE5MkNFOUI6NkIwMUVERkEiLCJ2aXNpdG9yX2lkIjoiOTA0OTUxODgxOTEzOTI1MTcwNiIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmac5f2c78e45cfc4a14244e592f3dfcea0d92f66eb2b46e072ed27e04223e0eb909
hovercard-subject-tagissue:5922603476
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/python/cpython/159702/issue_layout
twitter:imagehttps://opengraph.githubassets.com/d45665dee5e06c09c5d6f326bef124375bbfaf2f380f6817a739403989396b91/python/cpython/issues/159702
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/d45665dee5e06c09c5d6f326bef124375bbfaf2f380f6817a739403989396b91/python/cpython/issues/159702
og:image:altFeature or enhancement I ran a throughput benchmark for different json libraries. Float encoding is a particularly weak area for the json library, especially for large-magnitude floats. Would it be...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernamenineteendo
hostnamegithub.com
expected-hostnamegithub.com
None87e774ee7c6b3bee0490394e4d3e57ec9dbc956f74b87ea685dc8996c1676456
turbo-cache-controlno-preview
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-nameissues

Links:

Skip to contenthttps://github.com/python/cpython/issues/159702#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpython%2Fcpython%2Fissues%2F159702
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%2Fissues%2F159702
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=python%2Fcpython
Reloadhttps://github.com/python/cpython/issues/159702
Reloadhttps://github.com/python/cpython/issues/159702
Reloadhttps://github.com/python/cpython/issues/159702
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
New issuehttps://github.com/login?return_to=https://github.com/python/cpython/issues/159702
New issuehttps://github.com/login?return_to=https://github.com/python/cpython/issues/159702
Speed up float encoding in jsonhttps://github.com/python/cpython/issues/159702#top
https://github.com/corona10
extension-modulesC modules in the Modules dirhttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22extension-modules%22
performancePerformance or resource usagehttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22performance%22
type-featureA feature request or enhancementhttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22type-feature%22
https://github.com/nineteendo
nineteendohttps://github.com/nineteendo
on Oct 19, 2026https://github.com/python/cpython/issues/159702#issue-5922603476
throughput benchmarkhttps://jsonyx.readthedocs.io/en/latest/benchmark.html
@vstinnerhttps://github.com/vstinner
gh-159702: Add fast-path for float in _json encoder #159826https://github.com/python/cpython/pull/159826
nineteendohttps://github.com/nineteendo
type-featureA feature request or enhancementhttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22type-feature%22
on Oct 19, 2026https://github.com/python/cpython/issues/159702#event-33636330851
StanFromIrelandhttps://github.com/StanFromIreland
performancePerformance or resource usagehttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22performance%22
extension-modulesC modules in the Modules dirhttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22extension-modules%22
on Oct 19, 2026https://github.com/python/cpython/issues/159702#event-33665682999
StanFromIrelandhttps://github.com/StanFromIreland
JSON issueshttps://github.com/orgs/python/projects/6
on Oct 19, 2026https://github.com/python/cpython/issues/159702#event-33665691265
https://github.com/eendebakpt
eendebakpthttps://github.com/eendebakpt
on Oct 19, 2026https://github.com/python/cpython/issues/159702#issuecomment-6275906857
https://discuss.python.org/t/faster-float-to-string-conversions/107397https://discuss.python.org/t/faster-float-to-string-conversions/107397
corona10https://github.com/corona10
on Oct 19, 2026https://github.com/python/cpython/issues/159702#event-33689030894
https://github.com/corona10
corona10https://github.com/corona10
on Oct 19, 2026https://github.com/python/cpython/issues/159702#issuecomment-6278252663
@eendebakpthttps://github.com/eendebakpt
@nineteendohttps://github.com/nineteendo
@vstinnerhttps://github.com/vstinner
https://github.com/vstinner
vstinnerhttps://github.com/vstinner
on Oct 19, 2026https://github.com/python/cpython/issues/159702#issuecomment-6278395105
#125214https://github.com/python/cpython/pull/125214
#133969https://github.com/python/cpython/pull/133969
https://github.com/vstinner
vstinnerhttps://github.com/vstinner
on Oct 19, 2026https://github.com/python/cpython/issues/159702#issuecomment-6278424131
https://github.com/corona10
corona10https://github.com/corona10
on Oct 19, 2026https://github.com/python/cpython/issues/159702#issuecomment-6279506481
a good benchmarkhttps://github.com/python/pyperformance/blob/ccc0aeb7ad46d65b6dcd4160e0fdda4d885852dd/pyperformance/data-files/benchmarks/bm_json_dumps/run_benchmark.py#L19
https://github.com/vstinner
vstinnerhttps://github.com/vstinner
on Oct 20, 2026https://github.com/python/cpython/issues/159702#issuecomment-6280405793
https://github.com/vstinner
vstinnerhttps://github.com/vstinner
on Oct 20, 2026https://github.com/python/cpython/issues/159702#issuecomment-6280515797
vstinnerhttps://github.com/vstinner
on Oct 20, 2026https://github.com/python/cpython/issues/159702#event-33699100237
pythongh-159702: Add fast-path for float in _json encoderhttps://github.com/vstinner/cpython/commit/2edcecb7f9121dba1d7d680e6a038a0dc6acf7cc
pythongh-159702https://github.com/python/cpython/issues/159702
2edcecbhttps://github.com/vstinner/cpython/commit/2edcecb7f9121dba1d7d680e6a038a0dc6acf7cc
https://github.com/vstinner
vstinnerhttps://github.com/vstinner
on Oct 20, 2026https://github.com/python/cpython/issues/159702#issuecomment-6280832919
gh-159826https://github.com/python/cpython/pull/159826
https://github.com/vstinner
vstinnerhttps://github.com/vstinner
on Oct 20, 2026https://github.com/python/cpython/issues/159702#issuecomment-6280897326
@nineteendohttps://github.com/nineteendo
#156897https://github.com/python/cpython/pull/156897
gh-150638https://github.com/python/cpython/issues/150638
https://github.com/h-vetinari
h-vetinarihttps://github.com/h-vetinari
on Oct 21, 2026https://github.com/python/cpython/issues/159702#issuecomment-6314937200
Sign up for freehttps://github.com/signup?return_to=https://github.com/python/cpython/issues/159702
Sign in to commenthttps://github.com/login?return_to=https://github.com/python/cpython/issues/159702
corona10https://github.com/corona10
extension-modulesC modules in the Modules dirhttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22extension-modules%22
performancePerformance or resource usagehttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22performance%22
type-featureA feature request or enhancementhttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22type-feature%22
JSON issueshttps://github.com/orgs/python/projects/6
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.