Collect performance metrics for your library/application.
This release brings a lot of new stuff and fixes some critical bugs.
Introducing speedracer run
and speedracer display
. See below for more details.
Speed Racer aims to answer different needs. But one of the main objective is performance testing and the ability to run automatic performance regression tests. The first step to this feature is to be able to trace specific chunks of code like a unit test would do.
In Speed Racer's realm such a test is called a race. You can have multiple races per file, they are run serially.
A race can be declared like this:
import race from 'speedracer'
race('sync race', () => {
syncStuff()
})
race('async race', () => {
return new Promise(/* ... */)
})
You can run races like this: speedracer run file.js
or simply speedracer file.js
. By default Speed Racer will record every races in every JavaScript file found in the perf
directory.
Each race gets its associated trace and report after a run. By default, both are saved in .speedracer
directory. These two artifacts can then be analyzed for different purposes.
You may have a bunch of races. Displaying a detailed report for each one of them during the run does not make so much sense. I'm introducing a compact reporter that only gives live informations about the run itself. It looks like this:
I'll eventually open the api
for custom reporters.
The 0.1.x
behavior still exist behind the display
command. After a run, you can quickly display their associated reports like this: speedracer display
. By default Speed Racer will show all reports in .speedracer
directory.
api
: c914752add0907fd0ba489590128705112b9693e--duration
flag with timeout
: c914752add0907fd0ba489590128705112b9693e--traces
and --reports
flags: 987d16800f8c5c97bb150a833690f3e75d476aa5--no-trace
and --no-reports
flags: e4459411aa65b730d4d6c33a5b9e4a745fc5ac52--chrome-flags
flag: ff9050b9e0d7e6ba7080b06f163bb6f61418e48b--no-headless
flag: 71d124b4ca3df087731ee3f2a62c9aff59c4b2e2DEBUG=*
: c914752add0907fd0ba489590128705112b9693e