When we do performance testing or trying to improve application performance, we need reliable, repeatable data. We also need to track progress to understand how changes affect the performance application. And this task is not that easy especially when we are talking about testing against different conditions - bad network, poor CPU, etc. This package was called to remove this complexity and allow you to work on things that maters - your application.
Perfrunner is the performance testing tool for websites and web applications. It gives you the possibility to test the site against different network conditions. It tracks the progress and visualizes it with charts to make things clearer. And if you want to go deeper, it already saves the traces of each run to get you the whole information you need. It's fully customizable and supports reporting into HTML, JSON, CSV, or even your own reporter.
Tracks:
- First Contentful Paint
- Largest Contentful Paint
- Layout duration time
- Script duration time
- Resources size (js, css, img, fonts)
- And much more!
Lighthouse is an awesome tool when you want to see the current performance state.
Perfrunner should be used when you want to see the progress or difference between performance changes. It also exposes some technical metrics like time spent in layout rendering, style recalculations, and some more.
This is a simple comparison of the three default builds for the Angular/React/Vue applications (no gzip), just to demonstrate how Perfrunner works and looks.
- Simple UI to track performance changes
- Various metrics (FCP, LCP, resources size, etc.)
- Various output - HTML, JSON, CSV
- Good precision with automated multiple reruns
- Traces for further investigation
- Supports multiple network conditions - slow3g, fast3g, 4g
- Test your app with or without cache
npx perfrunner https://drag13.io/
Change something and run it again to check the difference
npx perfrunner https://drag13.io/ --network slow3g
npx perfrunner https://drag13.io/ --network slow3g -T 4
npx perfrunner https://drag13.io/ --network slow3g -T 4 --cache
npx perfrunner https://drag13.io/ --reporter json
For other commands check perfrunner-cli
Perfrunner supports config file. To use config file, run --init
command first:
npx perfrunner --init drag13.io
And run Perfrunner once more time without arguments
npx perfrunner
Perfrunner will use perfrunner.json
configuration file instead of input from the console. With a config file, you can use multiple URL and adjust network setup.
- perfrunner-cli - command line interface for the perfrunner
- perfrunner-core - runs tests and aggregate result
- perfrunner-reporters - process result
- raharrison for inspiration and examples