Commit 11374f4
perf: defer tracker initialization and slim import path (1/4) (#1251)
* perf: defer tracker initialization and slim import path
Lazy-load reference data, output handlers, hardware probing, and the
emissions engine so tracker construction stays fast when work is deferred.
Co-authored-by: Cursor <cursoragent@cursor.com>
* test: initialize hardware before cpu_load detection assertion
Deferred hardware setup in PR 1 requires _ensure_hardware_ready() in tests
that inspect tracker._hardware before start().
Co-authored-by: Cursor <cursoragent@cursor.com>
* fix: restore pandas DataFrame type hints in input.py
Use TYPE_CHECKING import for pd so lazy loading stays fast while keeping
return type annotations on get_cloud_emissions_data and get_cpu_power_data.
Co-authored-by: Cursor <cursoragent@cursor.com>
---------
Co-authored-by: Cursor <cursoragent@cursor.com>1 parent 150cac8 commit 11374f4
13 files changed
Lines changed: 220 additions & 107 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
11 | | - | |
| 11 | + | |
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
13 | | - | |
14 | 13 | | |
15 | 14 | | |
16 | 15 | | |
| |||
22 | 21 | | |
23 | 22 | | |
24 | 23 | | |
25 | | - | |
26 | | - | |
27 | 24 | | |
28 | 25 | | |
29 | | - | |
30 | | - | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
31 | 29 | | |
32 | 30 | | |
33 | 31 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
11 | | - | |
12 | 11 | | |
13 | 12 | | |
14 | 13 | | |
| |||
76 | 75 | | |
77 | 76 | | |
78 | 77 | | |
| 78 | + | |
| 79 | + | |
79 | 80 | | |
80 | 81 | | |
81 | 82 | | |
| |||
0 commit comments