From d30e183edbbad4a56e0ee9a3d6c62cbb00efabed Mon Sep 17 00:00:00 2001 From: Nathan Sobo Date: Tue, 13 Mar 2012 11:11:17 -0600 Subject: [PATCH] Add benchmark for inserting at the end of a file --- benchmark/benchmark-suite.coffee | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/benchmark/benchmark-suite.coffee b/benchmark/benchmark-suite.coffee index 02fcd9b1b..71dadc246 100644 --- a/benchmark/benchmark-suite.coffee +++ b/benchmark/benchmark-suite.coffee @@ -21,11 +21,21 @@ describe "Editor", -> beforeEach -> editor.setBuffer new Buffer(require.resolve('fixtures/medium.coffee')) - benchmark "inserting and deleting a character", -> - editor.insertText('x') - editor.backspace() + describe "when the cursor is at the beginning of the file", -> + benchmark "inserting and deleting a character at the beginning of the file", -> + editor.insertText('x') + editor.backspace() + + benchmark "inserting and deleting a character that causes massive re-highlighting", -> + editor.insertText('"') + editor.backspace() + + describe "when the cursor is at the end of the file", -> + beforeEach -> + editor.setCursorScreenPosition([Infinity, Infinity]) + + benchmark "inserting and deleting a character", -> + editor.insertText('"') + editor.backspace() - benchmark "inserting and deleting a character that causes massive token changed", -> - editor.insertText('"') - editor.backspace()