function benchmarkIndexGC() {
    const start = Date.now();
    let iterations = 0;

    while (Date.now() - start < 500) {
      let s = '';
      for (let j = 0; j < 10000; j++) s += 'a';
      if (s.length === 1) throw new Error('will never happen, but prevents compiler optimizations');

      iterations++;
    }

    const durationInSeconds = (Date.now() - start) / 1000;
    return Math.round(iterations / 10 / durationInSeconds);
  }
The GC-heavy benchmark that creates a string of length 10000 in a loop.
The returned index is the number of times per second the string can be created divided by 10.
The division by 10 is to keep similar magnitudes to an earlier version of BenchmarkIndex that
used a string length of 100000 instead of 10000.