grafana / k6

A modern load testing tool, using Go and JavaScript - https://k6.io
GNU Affero General Public License v3.0
26.13k stars 1.27k forks source link

Add option to not freeze SharedArray items #4051

Open mstoykov opened 2 weeks ago

mstoykov commented 2 weeks ago

Feature Description

Currently items out of SharedArray are frozen.

This was done predominantly to prevent people from thinking that editing them will have effect across iterations or VUs.

Unfortunately there are two side effects:

  1. It does actually require time to freeze items as seen in #3237
  2. if you will get an item and then edit it before doing something, you now need to make another copy

Suggested Solution (optional)

Add an option when making(?) the SharedArray to say that you do not want items to be frozen.

OR

Do not freeze any of the items to begin with

OR

Combine the above two - make SharedArray not freeze by default but add an option.

I personally think that we should go with option 1 for now and just add a new option. It is still likely better for most users to get them frozen and not turn out users are confused about.

Already existing or connected issues / PRs (optional)

No response