void () { Ref<MyElement> ref = new Ref<>(); PlatformTestUtil.startPerformanceTest("creating", 40_000, () -> ApplicationManager.getApplication().runWriteAction(() -> { MyElement element = createElement("<root xmlns=\"http://www.w3.org/1999/xhtml\"/>", MyElement.class); MyElement child = element.addChildElement(); child.getAttr().setValue("239"); child.getChild239().getAttr().setValue("42"); child.getChild().getAttr().setValue("42xx"); child.getChild2().getAttr().setValue("42yy"); child.addChildElement().getChild().addFooChild().getAttr().setValue("xxx"); child.addChildElement().addFooChild().getAttr().setValue("yyy"); child.addChildElement().addFooChild().addBarChild().addBarChild().addChildElement().getChild().getAttr().setValue("xxx"); child.addChildElement().addBarComposite().setValue("ssss"); child.addBarChild().getChild2().getAttr().setValue("234178956023"); for (int i = 0; i < 239; i++) { element.addChildElement().copyFrom(child); } ref.set(element); })) .assertTiming(); MyElement newElement = createElement(DomUtil.getFile(ref.get()).getText(), MyElement.class); PlatformTestUtil.startPerformanceTest("visiting", 450, () -> newElement.acceptChildren(new DomElementVisitor() { @Override public void visitDomElement(DomElement element) { element.acceptChildren(this); } })).assertTiming(); }