chore(structure): Tests and benchmarking script#923
Conversation
To get a baseline for current ts-morph implementation
✅ Deploy Preview for cedarjs canceled.
|
Greptile SummaryAdded comprehensive test infrastructure and benchmarking script to establish baseline metrics before migrating from ts-morph to oxc-parser. Key Additions:
Test Coverage:
The tests provide a safety net for refactoring and a baseline for comparing performance improvements when switching parsers. Confidence Score: 5/5
Important Files Changed
Sequence DiagramsequenceDiagram
participant Dev as Developer
participant Bench as benchmark.mts
participant RWP as RWProject
participant Tests as Test Suite
participant Fixtures as Test Fixtures
Note over Dev,Fixtures: PR Setup: Baseline Tests & Benchmarks
Dev->>Fixtures: Create structure-test-project
Fixtures-->>Tests: Provide test data
Dev->>Tests: Run test suite
Tests->>RWP: getProject(projectRoot)
RWP-->>Tests: Project instance
Tests->>RWP: Verify API contract
Tests->>RWP: Extract diagnostics
Tests->>RWP: Test extractors
Tests->>RWP: Integration tests
Tests->>RWP: Snapshot serialization
RWP-->>Tests: Results
Tests-->>Dev: Pass/Fail with snapshots
Dev->>Bench: Run benchmark script
Note over Bench: Warmup phase (2 iterations)
loop Warmup
Bench->>RWP: new RWProject()
RWP-->>Bench: Instance
Bench->>RWP: collectDiagnostics()
RWP-->>Bench: Diagnostics
end
Note over Bench: Measurement phase (10 iterations)
loop Measurements
Bench->>Bench: forceGC()
Bench->>RWP: new RWProject() [measure init]
RWP-->>Bench: Instance + timing
Bench->>RWP: collectDiagnostics() [cold]
RWP-->>Bench: Diagnostics + timing
Bench->>RWP: collectDiagnostics() [warm]
RWP-->>Bench: Cached results + timing
Bench->>Bench: Track memory delta
end
Bench->>Bench: calculateStats()
Bench-->>Dev: Performance report (mean/median/p95)
|
|
| Command | Status | Duration | Result |
|---|---|---|---|
nx run-many -t test --minWorkers=1 --maxWorkers=4 |
❌ Failed | 2m 8s | View ↗ |
nx run-many -t build:pack --exclude create-ceda... |
✅ Succeeded | 36s | View ↗ |
nx run-many -t build |
✅ Succeeded | 1m 47s | View ↗ |
nx run-many -t test:types |
✅ Succeeded | 11s | View ↗ |
☁️ Nx Cloud last updated this comment at 2026-03-18 18:16:37 UTC
0f0e039 to
aa1c62d
Compare
|
This PR is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days. |
83b6f47 to
f86a97b
Compare
|
This PR is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days. |

In preparation for switching over to oxc-format I need baseline perf metrics and good test coverage