void () { DocumentEx doc = new DocumentImpl(StringUtil.repeat("blah", 1000)); List<RangeMarker> markers = new ArrayList<>(); int N = 100_000; for (int i = 0; i < N; i++) { int start = i % doc.getTextLength(); int end = start + 1; RangeMarker marker = doc.createRangeMarker(start, end); markers.add(marker); } PlatformTestUtil.startPerformanceTest("RM.getStartOffset", 15000, ()->{ insertString(doc, 0, " "); for (int i=0; i<1000; i++) { for (RangeMarker rm : markers) { int length = rm.getEndOffset() - rm.getStartOffset(); assertEquals(1, length); assertTrue(rm.isValid()); } } deleteString(doc, 0, 1); }).assertTiming(); }