Improve performance of json.dumps and json.dump for strings
未關閉
還沒有人認領這個 Issue。
extension-modules
performance
stdlib
type-feature
- 主要語言
- Python
- 星號
- 77.2k
- 分支
- 35.9k
- PR 合併指標
- PR 指標待擷取
描述
For strings that do not require escaping we can bulk copy the data in ascii_escape_unicode and escape_unicode.
This is in preparation of addressing #129711 by creating a C implementation for json.dump.
Linked PRs
- gh-156242
貢獻指南
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
研究方向
先檢視連結的 PR gh-156242,並找出 ascii_escape_unicode 和 escape_unicode 的實作。確認目前如何處理不需要跳脫的字串,接著使用現有的 JSON 測試或基準測試來驗證輸出相同且效能有所提升。
由索引模型根據 Issue 內容生成。
評估
- 技術堆疊
- python
- 領域
- performance
- Issue 類型
- 重構
- 難度
- 3/5
- 預估耗時
- 1-2 天
- 活躍度
- 停滯
- 描述清晰度
- 基本清楚
- 新手友好度
- 35/100