Repository navigation
Commit 2edcecb
committed
pythongh-159702: Add fast-path for float in _json encoder
Optimize json encoder for floats: up to 1.3x faster.
Avoid creating a temporary Unicode object when writing the JSON
representation of a float: decode directly the ASCII-encoded string
(PyOS_double_to_string()) into the writer.1 parent 34fe59b commit 2edcecb
2 files changed
Lines changed: 49 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1532 | 1532 | | |
1533 | 1533 | | |
1534 | 1534 | | |
| 1535 | + | |
| 1536 | + | |
| 1537 | + | |
| 1538 | + | |
| 1539 | + | |
| 1540 | + | |
| 1541 | + | |
| 1542 | + | |
| 1543 | + | |
| 1544 | + | |
| 1545 | + | |
| 1546 | + | |
| 1547 | + | |
| 1548 | + | |
| 1549 | + | |
| 1550 | + | |
| 1551 | + | |
| 1552 | + | |
| 1553 | + | |
| 1554 | + | |
| 1555 | + | |
| 1556 | + | |
| 1557 | + | |
| 1558 | + | |
| 1559 | + | |
| 1560 | + | |
| 1561 | + | |
| 1562 | + | |
| 1563 | + | |
| 1564 | + | |
| 1565 | + | |
| 1566 | + | |
| 1567 | + | |
| 1568 | + | |
| 1569 | + | |
| 1570 | + | |
| 1571 | + | |
| 1572 | + | |
| 1573 | + | |
| 1574 | + | |
| 1575 | + | |
| 1576 | + | |
| 1577 | + | |
| 1578 | + | |
| 1579 | + | |
| 1580 | + | |
1535 | 1581 | | |
1536 | 1582 | | |
1537 | 1583 | | |
| |||
1596 | 1642 | | |
1597 | 1643 | | |
1598 | 1644 | | |
1599 | | - | |
1600 | | - | |
1601 | | - | |
1602 | | - | |
| 1645 | + | |
1603 | 1646 | | |
1604 | 1647 | | |
1605 | 1648 | | |
| |||
0 commit comments