# Rope benchmarks: Generate random strings measured in bytes, not chars \(\#39951\) · gitcafe/zed

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

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

Visibility: public

Requested revision: b519f53b3ecab94b0d9db6c87261657fb1c48c38

Requested commit: b519f53b3ecab94b0d9db6c87261657fb1c48c38

Commit: b519f53b3ecab94b0d9db6c87261657fb1c48c38

Tree: a2eab55a4c2c0965a78cb33c8fecd4a4e9e2ed7a

Author: Martin Pool

Committer: GitHub

## Message

```
Rope benchmarks: Generate random strings measured in bytes, not chars (#39951)

Follows on from https://github.com/zed-industries/zed/pull/39949.

Again I'm not 100% sure of the intent but I think this is a fix:

`generate_random_string(rng, 4096)` would previously give you a string
of 4096 *chars* which could be anywhere between 4kB and 16kB in bytes.
This seems probably not what was intended, because Ropes generally work
in bytes not chars, including for the offsets used to index into them.

This seems to possibly cause a _regression_ in benchmark performance,
which is surprising because it should generally cause smaller test data.
But, possibly it's doing better at exercising different paths?

cc @mrnugget 

Release Notes:

- N/A
```

## Parents

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

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