Commit 0305437
committed
Phase 13.14.GB: Vectorize _build_dense_lookup (3.6s → <0.05s)
Profile showed _build_dense_lookup Python loop was 58% of total time.
Replaced with vectorized numpy: shifted * strides, sum, fancy indexing.
Combined with previous bincount + prange optimizations:
Step 1 (bin mapping): 0.5s — unchanged
Step 2 (per-bin stats): 0.6s — bincount (was 2.3s)
Step 3 (window accum): 0.5s — prange (was 6s)
_build_dense_lookup: <0.05s — vectorized (was 3.6s)
Total per TF: ~1.5s (was 7-8s, originally 440s)
494 passed, 4 pre-existing, 0 regressions1 parent 209e7c2 commit 0305437
1 file changed
Lines changed: 6 additions & 6 deletions
Lines changed: 6 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4015 | 4015 | | |
4016 | 4016 | | |
4017 | 4017 | | |
4018 | | - | |
| 4018 | + | |
| 4019 | + | |
4019 | 4020 | | |
4020 | 4021 | | |
4021 | 4022 | | |
| |||
4029 | 4030 | | |
4030 | 4031 | | |
4031 | 4032 | | |
4032 | | - | |
4033 | | - | |
4034 | | - | |
4035 | | - | |
4036 | | - | |
| 4033 | + | |
| 4034 | + | |
| 4035 | + | |
| 4036 | + | |
4037 | 4037 | | |
4038 | 4038 | | |
4039 | 4039 | | |
| |||
0 commit comments