Skip to content

Commit

Permalink
Update goja
Browse files Browse the repository at this point in the history
This updates makes the runtime initialization faster and *lighter*.

For empty and fairly small scripts the observed initialization
improvement by some fast "benchmarking" for k6 this means:
1. around 3x faster initialization of VUs
2. around 4x less memory usage.

This likely will be nearly unnoticeable as this is only reasonably easy
to see with 100k VUs for the initialization speed where it goes from
around 10s to a little over 3s.

Adding more code increases both linearly, so bigger scripts will have
some speed up but it won't be 3x.

Same seems to be for memory usages as well.

Both of those likely get way worse if more and more of the JavaScript
"standard library" is used as in that case all of those now templated
properties will be used.
  • Loading branch information
mstoykov committed Sep 19, 2023
1 parent 22fd22a commit 5b50402
Show file tree
Hide file tree
Showing 41 changed files with 2,202 additions and 1,316 deletions.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ require (
github.com/PuerkitoBio/goquery v1.8.1
github.com/Soontao/goHttpDigestClient v0.0.0-20170320082612-6d28bb1415c5
github.com/andybalholm/brotli v1.0.5
github.com/dop251/goja v0.0.0-20230828202809-3dbe69dd2b8e
github.com/dop251/goja v0.0.0-20230919141708-865aea360f25
github.com/fatih/color v1.15.0
github.com/go-sourcemap/sourcemap v2.1.4-0.20211119122758-180fcef48034+incompatible
github.com/golang/protobuf v1.5.3
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,8 @@ github.com/dlclark/regexp2 v1.7.0/go.mod h1:DHkYz0B9wPfa6wondMfaivmHpzrQ3v9q8cnm
github.com/dlclark/regexp2 v1.9.0 h1:pTK/l/3qYIKaRXuHnEnIf7Y5NxfRPfpb7dis6/gdlVI=
github.com/dlclark/regexp2 v1.9.0/go.mod h1:DHkYz0B9wPfa6wondMfaivmHpzrQ3v9q8cnmRbL6yW8=
github.com/dop251/goja v0.0.0-20211022113120-dc8c55024d06/go.mod h1:R9ET47fwRVRPZnOGvHxxhuZcbrMCuiqOz3Rlrh4KSnk=
github.com/dop251/goja v0.0.0-20230828202809-3dbe69dd2b8e h1:UvQD6hTSfeM6hhTQ24Dlw2RppP05W7SWbWb6kubJAog=
github.com/dop251/goja v0.0.0-20230828202809-3dbe69dd2b8e/go.mod h1:QMWlm50DNe14hD7t24KEqZuUdC9sOTy8W6XbCU1mlw4=
github.com/dop251/goja v0.0.0-20230919141708-865aea360f25 h1:QMbwBGsztQRZO15o4qTPQif9Ipf4yz9KuCEJgNecomU=
github.com/dop251/goja v0.0.0-20230919141708-865aea360f25/go.mod h1:QMWlm50DNe14hD7t24KEqZuUdC9sOTy8W6XbCU1mlw4=
github.com/dop251/goja_nodejs v0.0.0-20210225215109-d91c329300e7/go.mod h1:hn7BA7c8pLvoGndExHudxTDKZ84Pyvv+90pbBjbTz0Y=
github.com/dop251/goja_nodejs v0.0.0-20211022123610-8dd9abb0616d/go.mod h1:DngW8aVqWbuLRMHItjPUyqdj+HWPvnQe8V8y1nDpIbM=
github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4=
Expand Down
14 changes: 13 additions & 1 deletion vendor/github.com/dop251/goja/array.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 13 additions & 1 deletion vendor/github.com/dop251/goja/array_sparse.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

201 changes: 120 additions & 81 deletions vendor/github.com/dop251/goja/builtin_array.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

29 changes: 22 additions & 7 deletions vendor/github.com/dop251/goja/builtin_boolean.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 5b50402

Please sign in to comment.