This release brings a lot of new stuff and fixes some critical bugs.
New commands
Introducing speedracer run
and speedracer display
. See below for more details.
Introducing races
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.
New reporter
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.
Report command
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.
Breaking changes
- Races
api
: c914752 - Change report structure: e8a403e
- Replace
--duration
flag withtimeout
: c914752 - Remove
--traces
and--reports
flags: 987d168