Repository navigation
Commit 5d43989
committed
perf(server): checkpoint capture scans the index listing by record instead of by byte
Each capture streams `git ls-files --full-name --sparse -v -z` (one
`<tag> <path>\0` record per index entry, 2 MB for t3code's 28k files)
through a callback that visits every byte on the server's main thread.
Only each record's tag, and skip-worktree paths in a sparse checkout, are
used, so the callback now jumps from one NUL to the next with indexOf.
On t3code's real listing the callback takes 1.2 ms instead of 5.8 ms
(17-33 ms on a cold first call), and a capture's main-thread busy time
drops by about 5 ms. The chunk-boundary test also runs with 3-byte
chunks, so records that continue across chunks and end mid-chunk are
covered.1 parent d8e9fd2 commit 5d43989
2 files changed
Lines changed: 35 additions & 18 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
707 | 707 | | |
708 | 708 | | |
709 | 709 | | |
710 | | - | |
711 | | - | |
712 | | - | |
| 710 | + | |
| 711 | + | |
| 712 | + | |
| 713 | + | |
| 714 | + | |
| 715 | + | |
| 716 | + | |
713 | 717 | | |
714 | 718 | | |
715 | 719 | | |
| |||
745 | 749 | | |
746 | 750 | | |
747 | 751 | | |
748 | | - | |
749 | | - | |
| 752 | + | |
| 753 | + | |
750 | 754 | | |
751 | 755 | | |
752 | 756 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
866 | 866 | | |
867 | 867 | | |
868 | 868 | | |
869 | | - | |
| 869 | + | |
870 | 870 | | |
871 | 871 | | |
872 | 872 | | |
| |||
876 | 876 | | |
877 | 877 | | |
878 | 878 | | |
| 879 | + | |
| 880 | + | |
| 881 | + | |
879 | 882 | | |
880 | | - | |
881 | | - | |
| 883 | + | |
| 884 | + | |
| 885 | + | |
| 886 | + | |
| 887 | + | |
| 888 | + | |
| 889 | + | |
| 890 | + | |
| 891 | + | |
| 892 | + | |
882 | 893 | | |
883 | | - | |
884 | | - | |
885 | | - | |
886 | | - | |
| 894 | + | |
| 895 | + | |
| 896 | + | |
| 897 | + | |
| 898 | + | |
| 899 | + | |
| 900 | + | |
887 | 901 | | |
888 | 902 | | |
889 | 903 | | |
890 | 904 | | |
891 | 905 | | |
892 | 906 | | |
893 | | - | |
894 | | - | |
895 | | - | |
896 | | - | |
897 | | - | |
| 907 | + | |
| 908 | + | |
| 909 | + | |
898 | 910 | | |
899 | | - | |
| 911 | + | |
| 912 | + | |
900 | 913 | | |
901 | 914 | | |
902 | 915 | | |
| |||
0 commit comments