Commit a92719d
committed
Optimize fill_time for typical timestamps
While file timestamps can be anything the file system can store, most
lie between the recent past and the near future. Optimize fill_time for
typical timestamps in three ways:
- When possible, convert to nanoseconds with C arithmetic.
- When using C arithmetic and the seconds member is not required (for
st_birthtime), avoid creating a long object.
- When using C arithmetic, reorder the code to avoid the null checks
implied in Py_XDECREF.1 parent d1d8409 commit a92719d
1 file changed
+34
-12
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2588 | 2588 | | |
2589 | 2589 | | |
2590 | 2590 | | |
| 2591 | + | |
| 2592 | + | |
| 2593 | + | |
| 2594 | + | |
| 2595 | + | |
| 2596 | + | |
| 2597 | + | |
| 2598 | + | |
| 2599 | + | |
| 2600 | + | |
| 2601 | + | |
| 2602 | + | |
| 2603 | + | |
| 2604 | + | |
| 2605 | + | |
| 2606 | + | |
| 2607 | + | |
| 2608 | + | |
| 2609 | + | |
| 2610 | + | |
| 2611 | + | |
| 2612 | + | |
| 2613 | + | |
| 2614 | + | |
| 2615 | + | |
| 2616 | + | |
| 2617 | + | |
| 2618 | + | |
| 2619 | + | |
| 2620 | + | |
| 2621 | + | |
| 2622 | + | |
| 2623 | + | |
2591 | 2624 | | |
2592 | 2625 | | |
2593 | 2626 | | |
2594 | 2627 | | |
2595 | | - | |
2596 | | - | |
2597 | 2628 | | |
2598 | 2629 | | |
2599 | 2630 | | |
| |||
2606 | 2637 | | |
2607 | 2638 | | |
2608 | 2639 | | |
2609 | | - | |
2610 | | - | |
2611 | | - | |
2612 | | - | |
2613 | | - | |
| 2640 | + | |
2614 | 2641 | | |
2615 | 2642 | | |
2616 | 2643 | | |
2617 | 2644 | | |
2618 | 2645 | | |
2619 | 2646 | | |
2620 | 2647 | | |
2621 | | - | |
2622 | | - | |
2623 | | - | |
2624 | | - | |
2625 | 2648 | | |
2626 | 2649 | | |
2627 | 2650 | | |
| |||
2635 | 2658 | | |
2636 | 2659 | | |
2637 | 2660 | | |
2638 | | - | |
2639 | 2661 | | |
2640 | 2662 | | |
2641 | 2663 | | |
| |||
0 commit comments