Slow performance of programmatic element creation via editDomain. [message #524658] |
Thu, 01 April 2010 17:17 |
Indigo Mising name Messages: 14 Registered: August 2009 |
Junior Member |
|
|
In my GMF editor, I'm reading in a data file and creating the model elements programmatically. I'm using the usual approach, basically:
- create my model element using a factory
- create a ViewDescriptor
- create a ViewRequest
- create a CreateViewCommand and finally
- execute the command, like this:
myModelEditPart.getDiagramEditDomain().getDiagramCommandStac k().execute(createViewCommand);
This works, but it's very, very slow to execute. To create a diagram with about 100 elements (i.e. labels, rectangles, compartments, etc.) takes about 1 minute. Almost all the time is spent inside the execute() command.
On the other hand, once the diagram is generated and saved, I can rerun the editor and bring up the saved diagram (File->Open) and it displays almost instantly. So it's not the rendering time that is taking a long time, somehow it's the creation of the elements.
If anyone has any idea what I could do to speed up the creation of large numbers of elements, I would greatly appreciate it.
Thanks!
|
|
|
Powered by
FUDForum. Page generated in 0.01395 seconds