Software Testing & QA (50 Qs)•Part 3: Advanced Internals, Scale & Production Quality (Senior / Lead)
Performance Profiling in Automated Tests: Benchmarking CPU and Memory Regressions.
senior LevelCode ExampleFormsPerformance
In Simple Words: Catching performance degradations in CI before code merges:
- Using benchmark harnesses (e.g.
tinybenchor Vitest bench):typescriptimport { bench } from 'vitest'; bench('fast JSON parser vs JSON.parse', () => { fastParse(payload); }); - Compare operations per second against the baseline on
main. Fail CI if performance degrades by $> 15%$.