chromium/third_party/blink/perf_tests/layout/editing_insert.html

<!DOCTYPE html>
<body>
<script src="../resources/runner.js"></script>
<script src="resources/line-layout-perf-test.js"></script>
<style>
#container {
  width: 120ch;
  white-space: pre-wrap;
  overflow-wrap: break-word;
}
</style>
<pre id="container">A</pre>
<script>
const kNumberOfWords = 100;
const kSampleText = (() => {
  const words = [];
  for (let i = 1; i <= kNumberOfWords; ++i) {
    words.push(TextGenerator.createWord(i % 12 + 3));
    if (i % 10 === 0)
      words.push('\n');
  }
  return words.join(' ');
})().repeat(1);

const kCount = 10;

const container = document.getElementById('container');
const editable = container.firstChild;

PerfTestRunner.measureRunsPerSecond({
  run: function() {
    for (let i = 0; i < kCount; ++i) {
      editable.nodeValue = kSampleText;
      PerfTestRunner.forceLayout();
      editable.insertData(10, 'xyz');
      PerfTestRunner.forceLayout();
    }
  },
});
</script>