-
Notifications
You must be signed in to change notification settings - Fork 14
chore(structure): Tests and benchmarking script #923
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
To get a baseline for current ts-morph implementation
✅ Deploy Preview for cedarjs ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
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 build |
❌ Failed | 4s | View ↗ |
☁️ Nx Cloud last updated this comment at 2026-01-03 12:58:05 UTC

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