Skip to content

Commit

Permalink
Update compatiblity-mode information around v0.31.0 (#240)
Browse files Browse the repository at this point in the history
Co-authored-by: Ivan Mirić <[email protected]>
Co-authored-by: na-- <[email protected]>
  • Loading branch information
3 people authored Mar 18, 2021
1 parent d3f4794 commit 0d2b6d8
Showing 1 changed file with 3 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -117,10 +117,9 @@ $ K6_COMPATIBILITY_MODE=extended k6 run script.js

</CodeGroup>

Transforms scripts to ES5.1 using Babel with ES2015 preset, and loads
[core.js](https://github.com/zloirock/core-js) v2 polyfills. This is
the default mode, providing greater JavaScript compatibility, at the
expense of startup time, RAM usage and performance.
In case of syntax/parsing errors, the script will be transformed using Babel with specific plugins bringing the compatibility to ES2015(ES6)+. This means that features such as classes and arrow functions can be used. This does take some time to transpile and the produced code has slightly different line/column numbers.

Before k6 v0.31.0, [core.js](https://github.com/zloirock/core-js) v2 and even more Babel plugins were also included in extended mode. This added around 2MB extra memory usage per VU and some of the transformations (generators, async/await) of Babel were not useful as they were still not enough for k6 to just work with those features. So, before v0.31.0, using `--compatibility-mode=base` was a significant improvement on memory usage, which also translated to some CPU gains.

## Performance Comparison

Expand Down

0 comments on commit 0d2b6d8

Please sign in to comment.