Notice: This Wiki is now read only and edits are no longer possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.
Difference between revisions of "EmfIndex Comparison"
Line 1: | Line 1: | ||
− | This page is intended to compare the two index implementations form different viewpoints.<br> | + | This page is intended to compare the two index implementations form different viewpoints.<br> |
= Performance = | = Performance = | ||
Line 7: | Line 7: | ||
=== Indexing time === | === Indexing time === | ||
− | This test measured the time which is needed to index x-times the content of Ecore.ecore. (Containing 393 instances of EObject and 520 references)<br> | + | This test measured the time which is needed to index x-times the content of Ecore.ecore. (Containing 393 instances of EObject and 520 references)<br> |
− | {| cellspacing="1" cellpadding="1" | + | {| class="FCK__ShowTableBorders" cellspacing="1" cellpadding="1" |
|- | |- | ||
| [[Image:EmfIndex indexingTime.png|thumb]] | | [[Image:EmfIndex indexingTime.png|thumb]] | ||
Line 15: | Line 15: | ||
{| border="1" | {| border="1" | ||
|- | |- | ||
− | | <br> | + | | <br> |
| 1000 | | 1000 | ||
| 2000 | | 2000 | ||
Line 33: | Line 33: | ||
|} | |} | ||
− | === Index save time | + | === Index save time (logarithmic scale on x and y axis) === |
− | This test measured the time which is needed to dump the index to file system.<br> | + | This test measured the time which is needed to dump the index to file system.<br> |
− | {| cellspacing="1" cellpadding="1" | + | {| class="FCK__ShowTableBorders" cellspacing="1" cellpadding="1" |
|- | |- | ||
| [[Image:EmfIndex indexSaveTime.png|thumb]] | | [[Image:EmfIndex indexSaveTime.png|thumb]] | ||
Line 43: | Line 43: | ||
{| border="1" | {| border="1" | ||
|- | |- | ||
− | | <br> | + | | <br> |
| 1 | | 1 | ||
| 2 | | 2 | ||
− | | 4 | + | | 4 |
− | | 8 | + | | 8 |
− | | 16 | + | | 16 |
− | | 32 | + | | 32 |
− | | 64 | + | | 64 |
− | | 128 | + | | 128 |
− | | 256 | + | | 256 |
− | | 512 | + | | 512 |
− | | 1024 | + | | 1024 |
| 2048 | | 2048 | ||
|- | |- | ||
| SAP | | SAP | ||
− | | 12 ms | + | | 12 ms |
− | | 12 ms | + | | 12 ms |
− | | 25 ms | + | | 25 ms |
− | | 40 ms | + | | 40 ms |
− | | 78 ms | + | | 78 ms |
− | | 134 ms | + | | 134 ms |
− | | 247 ms | + | | 247 ms |
| 642 ms | | 642 ms | ||
− | | 1123 ms | + | | 1123 ms |
− | | 2405 ms | + | | 2405 ms |
− | | 5023 ms | + | | 5023 ms |
| 9538 ms | | 9538 ms | ||
|- | |- | ||
| Itemis | | Itemis | ||
− | | 766 ms | + | | 766 ms |
− | | 1482 ms | + | | 1482 ms |
− | | 2917 ms | + | | 2917 ms |
− | | 5741 ms | + | | 5741 ms |
− | | 11497 ms | + | | 11497 ms |
| 23090 ms | | 23090 ms | ||
|} | |} | ||
Line 84: | Line 84: | ||
=== Memory consumption === | === Memory consumption === | ||
− | This test measured the in memory size of the index. In the SAP case, paging was disabled<br> | + | This test measured the in memory size of the index. In the SAP case, paging was disabled<br> |
− | {| cellspacing="1" cellpadding="1" | + | {| class="FCK__ShowTableBorders" cellspacing="1" cellpadding="1" |
|- | |- | ||
| [[Image:EmfIndex AllInMemory.png|thumb]] | | [[Image:EmfIndex AllInMemory.png|thumb]] | ||
| | | | ||
− | <br> | + | <br> |
{| border="1" | {| border="1" | ||
|- | |- | ||
− | | <br> | + | | <br> |
| 1000 | | 1000 | ||
| 2000 | | 2000 | ||
Line 110: | Line 110: | ||
|} | |} | ||
− | <br> | + | <br> |
|} | |} | ||
Line 116: | Line 116: | ||
== Query response time == | == Query response time == | ||
− | === Query All EObject and all EReferences<br> | + | === Query All EObject and all EReferences<br> === |
− | {| cellspacing="1" cellpadding="1" | + | {| class="FCK__ShowTableBorders" cellspacing="1" cellpadding="1" |
|- | |- | ||
| [[Image:EmfIndex ResponseTimeAllEObjects.png|thumb]] | | [[Image:EmfIndex ResponseTimeAllEObjects.png|thumb]] | ||
Line 124: | Line 124: | ||
{| border="1" | {| border="1" | ||
|- | |- | ||
− | | <br> | + | | <br> |
| 1000 | | 1000 | ||
| 2000 | | 2000 | ||
Line 140: | Line 140: | ||
|} | |} | ||
− | <br> | + | <br> |
|} | |} | ||
− | <br> | + | <br> |
− | === Query all references targeting a certain resource (logarithmic scale on x and y axis)<br> | + | === Query all references targeting a certain resource (logarithmic scale on x and y axis)<br> === |
− | {| cellspacing="1" cellpadding="1" | + | {| class="FCK__ShowTableBorders" cellspacing="1" cellpadding="1" |
|- | |- | ||
| [[Image:EmfIndex ResponseTimeBackwardNavi.png|thumb]] | | [[Image:EmfIndex ResponseTimeBackwardNavi.png|thumb]] | ||
Line 154: | Line 154: | ||
{| border="1" | {| border="1" | ||
|- | |- | ||
− | | <br> | + | | <br> |
| 1 | | 1 | ||
| 2 | | 2 | ||
Line 184: | Line 184: | ||
|} | |} | ||
− | <br> | + | <br> |
|} | |} | ||
− | <br> | + | <br> |
− | === Query all instances of "EClass" (logarithmic scale on x and y axis)<br> | + | === Query all instances of "EClass" (logarithmic scale on x and y axis)<br> === |
− | {| cellspacing="1" cellpadding="1" | + | {| class="FCK__ShowTableBorders" cellspacing="1" cellpadding="1" |
|- | |- | ||
| [[Image:EmfIndex ResponseTimeTypeQuery.png|thumb]] | | [[Image:EmfIndex ResponseTimeTypeQuery.png|thumb]] | ||
Line 198: | Line 198: | ||
{| border="1" | {| border="1" | ||
|- | |- | ||
− | | <br> | + | | <br> |
| 128 | | 128 | ||
| 256 | | 256 | ||
Line 220: | Line 220: | ||
|} | |} | ||
− | <br> | + | <br> |
|} | |} | ||
− | <br> | + | <br> |
− | === Navigation Query required for convenient API<br> | + | === Navigation Query required for convenient API<br> === |
− | These values show how fast the queries respond that are required to simulate interconnected descriptors. | + | These values show how fast the queries respond that are required to simulate interconnected descriptors. |
− | {| cellspacing="1" cellpadding="1" | + | {| class="FCK__ShowTableBorders" cellspacing="1" cellpadding="1" |
|- | |- | ||
| [[Image:EmfIndex ResponseTimeNavigationQueries.png|thumb]] | | [[Image:EmfIndex ResponseTimeNavigationQueries.png|thumb]] | ||
Line 249: | Line 249: | ||
|} | |} | ||
− | <br> | + | <br> |
|} | |} | ||
− | <br> <br> | + | <br><br> |
= Convenient query API = | = Convenient query API = | ||
Line 262: | Line 262: | ||
public class ConvenientIndexQueryFactory { | public class ConvenientIndexQueryFactory { | ||
− | + | public ConvenientEObjectQuery<?> createEObjectQuery() { | |
− | + | ... | |
− | + | } | |
− | + | public ConvenientEReferenceQuery<?> createEReferenceQuery() { | |
− | + | ... | |
− | + | } | |
− | + | public ConvenientResourceQuery<ConvenientResourceDescriptor> createResourceQuery() { | |
− | + | return new ConvenientResourceQueryImpl<ConvenientResourceDescriptor>(); | |
− | + | } | |
</source> | </source> | ||
Line 280: | Line 280: | ||
public class ConvenientResourceQueryImpl<T> extends ResourceQueryImpl<T> implements ConvenientResourceQuery<T> { | public class ConvenientResourceQueryImpl<T> extends ResourceQueryImpl<T> implements ConvenientResourceQuery<T> { | ||
− | + | @Override | |
− | + | public QueryResult<T> createQueryResult(QueryExecutorInternal queryExecutor, Iterable<ResourceDescriptor> result) { | |
− | + | return ...; // new QueryResult implementation | |
− | + | } | |
} | } | ||
Line 293: | Line 293: | ||
public class ConvenientUser { | public class ConvenientUser { | ||
− | + | public void test() { | |
− | + | final ConvenientResourceQuery<ConvenientResourceDescriptor> query = new ConvenientIndexQueryFactory().createResourceQuery(); | |
− | + | query.uri("hallo"); | |
− | + | Index index = ...; | |
− | + | index.executeQueryCommand(new QueryCommand() { | |
− | + | @Override | |
− | + | public void execute(QueryExecutor queryExecutor) { | |
− | + | QueryResult<ConvenientResourceDescriptor> execute = queryExecutor.execute(query); | |
− | + | } | |
− | + | }); | |
− | + | } | |
} | } | ||
</source> | </source> |
Revision as of 03:20, 3 September 2009
This page is intended to compare the two index implementations form different viewpoints.
Performance
Indexing
Indexing time
This test measured the time which is needed to index x-times the content of Ecore.ecore. (Containing 393 instances of EObject and 520 references)
|
Index save time (logarithmic scale on x and y axis)
This test measured the time which is needed to dump the index to file system.
|
Memory consumption
This test measured the in memory size of the index. In the SAP case, paging was disabled
|
Query response time
Query All EObject and all EReferences
|
Query all references targeting a certain resource (logarithmic scale on x and y axis)
|
Query all instances of "EClass" (logarithmic scale on x and y axis)
|
These values show how fast the queries respond that are required to simulate interconnected descriptors.
|
Convenient query API
The following proposal can be implemented on top of the low level API to provide a more convenient query API as proposed by Itemis. The basic idea would be to provide a specialized query factory for the convenient queries, which returns wrappers around the low level query objects. The query wrapper would also return a wrapped QueryResult object which in turn wraps the low level descriptors. The following snippet shows an example of the query factory.
public class ConvenientIndexQueryFactory { public ConvenientEObjectQuery<?> createEObjectQuery() { ... } public ConvenientEReferenceQuery<?> createEReferenceQuery() { ... } public ConvenientResourceQuery<ConvenientResourceDescriptor> createResourceQuery() { return new ConvenientResourceQueryImpl<ConvenientResourceDescriptor>(); }
The returned resource query needs to subclass our ResourceQueryImpl class and override the createQueryResult() method. This method gets an iterable with low level descriptors. The QueryResult only implements the Iterable interface and has no further methods.
public class ConvenientResourceQueryImpl<T> extends ResourceQueryImpl<T> implements ConvenientResourceQuery<T> { @Override public QueryResult<T> createQueryResult(QueryExecutorInternal queryExecutor, Iterable<ResourceDescriptor> result) { return ...; // new QueryResult implementation } }
A convenient user may use this API as like as the low level API:
public class ConvenientUser { public void test() { final ConvenientResourceQuery<ConvenientResourceDescriptor> query = new ConvenientIndexQueryFactory().createResourceQuery(); query.uri("hallo"); Index index = ...; index.executeQueryCommand(new QueryCommand() { @Override public void execute(QueryExecutor queryExecutor) { QueryResult<ConvenientResourceDescriptor> execute = queryExecutor.execute(query); } }); } }