From b54ddf10ceb16687a8ca1becbc457ff0e7f99c4d Mon Sep 17 00:00:00 2001 From: Soreine Date: Mon, 7 Nov 2016 17:26:51 +0100 Subject: [PATCH] Add benchmark for Node.getTexts --- perf/benchmarks/get-texts-normal/index.js | 6 ++++ perf/benchmarks/get-texts-normal/input.yaml | 40 +++++++++++++++++++++ 2 files changed, 46 insertions(+) create mode 100644 perf/benchmarks/get-texts-normal/index.js create mode 100644 perf/benchmarks/get-texts-normal/input.yaml diff --git a/perf/benchmarks/get-texts-normal/index.js b/perf/benchmarks/get-texts-normal/index.js new file mode 100644 index 000000000..79c107ae3 --- /dev/null +++ b/perf/benchmarks/get-texts-normal/index.js @@ -0,0 +1,6 @@ + +module.exports = { + run(state) { + state.document.getTexts() + } +} diff --git a/perf/benchmarks/get-texts-normal/input.yaml b/perf/benchmarks/get-texts-normal/input.yaml new file mode 100644 index 000000000..1493994a7 --- /dev/null +++ b/perf/benchmarks/get-texts-normal/input.yaml @@ -0,0 +1,40 @@ +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: '