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.
EmfIndex Comparison
This page is intended to compare the two index implementations form different viewpoints.
Performance
Performance measurement was done on a T61 laptop.
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 by use of the Memory Analyzer Tool. In the SAP case, paging was disabled
|
Query response time
Query All Resources, 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.
|
Required Size on Disc
These values show the amount of kilobytes per Ecore content.
|
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); } }); } }