| Summary: | [Serializer] performance leak due to inefficient INodes navigation in NodeIterator | ||||||
|---|---|---|---|---|---|---|---|
| Product: | [Modeling] TMF | Reporter: | Wladimir Safonov <wladimir.safonov> | ||||
| Component: | Xtext | Assignee: | Project Inbox <tmf.xtext-inbox> | ||||
| Status: | CLOSED FIXED | QA Contact: | |||||
| Severity: | normal | ||||||
| Priority: | P3 | CC: | moritz.eysholdt, sebastian.zarnekow | ||||
| Version: | 2.0.0 | Flags: | sebastian.zarnekow:
indigo+
|
||||
| Target Milestone: | SR1 | ||||||
| Hardware: | All | ||||||
| OS: | All | ||||||
| Whiteboard: | |||||||
| Attachments: |
|
||||||
Thanks for the report and the patch. We'll look into it. patch applied and pushed to master. Thx Wladimir. In case we decide to implement bug 351822, we can deprecate this NodeIterator and use org.eclipse.xtext.nodemodel.util.NodeTreeIterator instead. Closing all bugs that were set to RESOLVED before Neon.0 Closing all bugs that were set to RESOLVED before Neon.0 |
Created attachment 199451 [details] Using INodes methods for obtaining next/prev/first/last siblings Apparently migration to the new INodes API introduced a considerable performance leak in the class org.eclipse.xtext.parsetree.reconstr.impl.NodeIterator. In several places it makes use of the Lists.newArrayList(Iterable<INode>) to create a list of child nodes where eventually only one element will be picked up. This causes all children to be iterated through and collected in a new list. However dedicated methods on the INode can deliver the element of interest in one single get operation. I attached a patch, which reduced serialization time for my model from 30 sec down to approx 2 sec. The model has a simple containment tree without any cross-references and has ~5 elements depth, but ~9K elements breadth, which is probably the reason of why iterations through the nodes take most of the serialization time.