Repository navigation
Commit 641f7a1
committed
perf(ccusage): use native JSONL discovery
Replace tinyglobby usage in the ccusage hot path with a small native readdir-based JSONL walker. The loader now avoids starting the glob engine for daily, session-by-id, block, and debug mismatch discovery, keeps deterministic file order with path sorting, and removes tinyglobby from the ccusage app dependencies.
Reliable runtime benchmark data is not included in this commit because process checks still showed cmux at roughly 150% CPU and another node ccusage process. The built bundle remains 515.86 kB total after this change.
Verified with pnpm run format, pnpm typecheck, pnpm --filter ccusage exec vitest run src/data-loader.ts src/debug.ts, pnpm --filter ccusage run build, pnpm run test, and JS/Rust token-total parity checks for daily/session/monthly/weekly/blocks.1 parent 8051465 commit 641f7a1
5 files changed
Lines changed: 40 additions & 46 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
95 | 95 | | |
96 | 96 | | |
97 | 97 | | |
98 | | - | |
99 | 98 | | |
100 | 99 | | |
101 | 100 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
68 | 68 | | |
69 | 69 | | |
70 | 70 | | |
71 | | - | |
72 | | - | |
73 | | - | |
74 | | - | |
75 | | - | |
76 | | - | |
77 | 71 | | |
78 | 72 | | |
79 | 73 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
16 | | - | |
| 16 | + | |
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
| |||
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
26 | | - | |
27 | 26 | | |
28 | 27 | | |
29 | 28 | | |
30 | 29 | | |
31 | 30 | | |
32 | 31 | | |
33 | | - | |
34 | 32 | | |
35 | 33 | | |
36 | 34 | | |
| |||
1125 | 1123 | | |
1126 | 1124 | | |
1127 | 1125 | | |
| 1126 | + | |
| 1127 | + | |
| 1128 | + | |
| 1129 | + | |
| 1130 | + | |
| 1131 | + | |
| 1132 | + | |
| 1133 | + | |
| 1134 | + | |
| 1135 | + | |
| 1136 | + | |
| 1137 | + | |
| 1138 | + | |
| 1139 | + | |
| 1140 | + | |
| 1141 | + | |
| 1142 | + | |
| 1143 | + | |
| 1144 | + | |
| 1145 | + | |
| 1146 | + | |
| 1147 | + | |
| 1148 | + | |
| 1149 | + | |
1128 | 1150 | | |
1129 | 1151 | | |
1130 | 1152 | | |
| |||
1133 | 1155 | | |
1134 | 1156 | | |
1135 | 1157 | | |
1136 | | - | |
1137 | | - | |
1138 | | - | |
1139 | | - | |
| 1158 | + | |
1140 | 1159 | | |
1141 | | - | |
1142 | 1160 | | |
1143 | 1161 | | |
1144 | 1162 | | |
| |||
1629 | 1647 | | |
1630 | 1648 | | |
1631 | 1649 | | |
1632 | | - | |
1633 | | - | |
1634 | | - | |
1635 | | - | |
1636 | | - | |
1637 | | - | |
1638 | | - | |
1639 | | - | |
1640 | | - | |
1641 | | - | |
| 1650 | + | |
| 1651 | + | |
| 1652 | + | |
| 1653 | + | |
| 1654 | + | |
| 1655 | + | |
| 1656 | + | |
| 1657 | + | |
| 1658 | + | |
| 1659 | + | |
1642 | 1660 | | |
1643 | | - | |
1644 | | - | |
1645 | 1661 | | |
1646 | 1662 | | |
1647 | 1663 | | |
| |||
1871 | 1887 | | |
1872 | 1888 | | |
1873 | 1889 | | |
1874 | | - | |
1875 | | - | |
1876 | | - | |
1877 | | - | |
1878 | | - | |
| 1890 | + | |
1879 | 1891 | | |
1880 | 1892 | | |
1881 | 1893 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
14 | | - | |
15 | 14 | | |
16 | | - | |
17 | | - | |
18 | | - | |
19 | | - | |
20 | | - | |
| 15 | + | |
21 | 16 | | |
22 | | - | |
| 17 | + | |
23 | 18 | | |
24 | 19 | | |
25 | 20 | | |
| |||
87 | 82 | | |
88 | 83 | | |
89 | 84 | | |
90 | | - | |
91 | | - | |
92 | | - | |
93 | | - | |
| 85 | + | |
94 | 86 | | |
95 | 87 | | |
96 | 88 | | |
| |||
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
0 commit comments