diff --git a/perf/benchmarks/insert-text-normal/index.js b/perf/benchmarks/insert-text-normal/index.js new file mode 100644 index 000000000..bbec3fc82 --- /dev/null +++ b/perf/benchmarks/insert-text-normal/index.js @@ -0,0 +1,14 @@ + +module.exports = { + setup(state) { + // Move cursor + return state.transform() + .collapseToStartOf({ key: '_cursor_' }) + .moveForward(10) // Move inside the text + .apply() + }, + + run(state) { + return state.transform().insertText('a').apply() + } +} diff --git a/perf/benchmarks/insert-text-normal/input.yaml b/perf/benchmarks/insert-text-normal/input.yaml new file mode 100644 index 000000000..8b04d1a3a --- /dev/null +++ b/perf/benchmarks/insert-text-normal/input.yaml @@ -0,0 +1,41 @@ +nodes: +- kind: block + type: paragraph + nodes: + - kind: text + ranges: + - text: 'This is editable ' + - text: 'rich' + marks: + - type: bold + - text: ' text, ' + - text: 'much' + marks: + - type: italic + - text: ' better than a ' + - text: '