Refactor: Performance Tracker
Before:
- Render phase exceeded 5 seconds, with no clear indication of where time was being spent.
- Phase-level instrumentation was difficult to interpret, slowing root-cause analysis.
- No visibility into user attrition during page load
After:
- Isolated the network call as the primary performance bottleneck.
- Reworked phase instrumentation into a clear, readable breakdown that made the critical path easier to diagnose.
- Added user attrition tracking while preserving the stability of key performance metrics, including TTFP.
The optimizations
The first step in optimizing these pages was to assess what was broken and identify the bottlenecks. After reviewing the code, I discovered:
- A method that executed 75 times per load on the first page.
- Tracking phases that were not stopping properly.
- Significant bugs in the existing code that performed unnecessary tasks beyond just measuring time, inflating the total execution time.
- Repeated nested method invocations, adding to the overhead.
AI-assisted diff analysis was used as a secondary verification layer; architectural decisions, implementation, performance analysis, and final validation remained engineer-owned.
