Skip to content

Commit 0d2b6d8

Browse files
mstoykovIvan Mirićna--
authored
Update compatiblity-mode information around v0.31.0 (#240)
Co-authored-by: Ivan Mirić <[email protected]> Co-authored-by: na-- <[email protected]>
1 parent d3f4794 commit 0d2b6d8

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

src/data/markdown/docs/01 guides/02 Using k6/19 Javascript Compatibility Mode.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -117,10 +117,9 @@ $ K6_COMPATIBILITY_MODE=extended k6 run script.js
117117

118118
</CodeGroup>
119119

120-
Transforms scripts to ES5.1 using Babel with ES2015 preset, and loads
121-
[core.js](https://github.com/zloirock/core-js) v2 polyfills. This is
122-
the default mode, providing greater JavaScript compatibility, at the
123-
expense of startup time, RAM usage and performance.
120+
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.
121+
122+
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.
124123

125124
## Performance Comparison
126125

0 commit comments

Comments
 (0)