void () { initText(StringUtil.repeat("\nLorem ipsum", 10_000)); TextAttributes attributes = new TextAttributes(Color.red, null, null, null, Font.PLAIN); for (int offset = 0; offset < getEditor().getDocument().getTextLength(); offset++) { getEditor().getMarkupModel().addRangeHighlighter(offset, offset + 1, 0, attributes, HighlighterTargetArea.EXACT_RANGE); } getEditor().getCaretModel().moveToOffset(0); PlatformTestUtil.startPerformanceTest("Editing with a lot of highlighters", 5000, () -> { for (int i = 0; i < 50; i++) { executeAction(IdeActions.ACTION_EDITOR_ENTER); UIUtil.dispatchAllInvocationEvents(); // let gutter update its width } }).assertTiming(); }