# Fix use of PRNG in Rope benchmarks \(\#39949\) · gitcafe/zed

[View on GitCafe](https://git.cafe/gitcafe/zed/commit/65acf125fb028b2bfb39564fdf565785871ea148)

Repository: [gitcafe/zed](https://git.cafe/gitcafe/zed)

Visibility: public

Requested revision: 65acf125fb028b2bfb39564fdf565785871ea148

Requested commit: 65acf125fb028b2bfb39564fdf565785871ea148

Commit: 65acf125fb028b2bfb39564fdf565785871ea148

Tree: b2a8a6def90d7af54ea8aeff82328cf5cd5a3625

Author: Martin Pool

Committer: GitHub

## Message

```
Fix use of PRNG in Rope benchmarks (#39949)

Using a seeded PRNG to produce consistent test data and reduce
variability makes sense.

However, the way it was used previously, by always cloning the RNG,
means that every generated string is the same, and every offset is the
same. After this change, the tested value stream should still be the same on
each run of the benchmark, but the values within each run will vary.

The `generate_random_text` measured in chars also seems possibly
inconsistent with later comments about it being a number of bytes.

Release Notes:

- N/A
```

## Parents

- [2adc02309450fb23f3b7bca5a47c4340c6f334c8](https://git.cafe/gitcafe/zed/commit/2adc02309450fb23f3b7bca5a47c4340c6f334c8?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zed/tree/65acf125fb028b2bfb39564fdf565785871ea148?format=markdown)
