[EMFStore] Performance Measure [message #1803787] |
Sat, 09 March 2019 19:33  |
Eclipse User |
|
|
|
Hi Everyone,
I tried to run the following code to measure the performance of EMFStore by adding 2010 elements to a root element and measuring the delta time for each addition:
NodeFactory factory = NodeFactory.eINSTANCE;
Node root = factory.createNode();
root.setName("Node 0");
project.getModelElements().add(root);
for (int i = 1; i <= 2010; i++) {
Node node = factory.createNode();
node.setName("Node " + i);
long start = System.currentTimeMillis();
root.getChildren().add(node);
long end = System.currentTimeMillis();
System.out.println(i + ": " + (end - start) + " ms");
}
Apparently, the performance of EMFStore becomes slower as the number of elements increases.
The performance of adding the first 10 nodes is as follows:
1: 0 ms
2: 0 ms
3: 16 ms
4: 0 ms
5: 0 ms
6: 16 ms
7: 0 ms
8: 0 ms
9: 15 ms
10: 0 ms
And the performance of adding the last 10 nodes is as follows:
2001: 122 ms
2002: 125 ms
2003: 156 ms
2004: 110 ms
2005: 125 ms
2006: 109 ms
2007: 125 ms
2008: 109 ms
2009: 125 ms
2010: 119 ms
Any idea what causes the slowdown? What should I do to improve the performance?
Cheers,
[Updated on: Sat, 09 March 2019 19:35] by Moderator
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.03710 seconds