Hi Hazelcast team,
I do the test with aggregation of Hazelcast 3.9.2. And I got a not really good performance
Cache Size: 100000 entries (4.18 KB/entry)
Average query time: 156 millisecond
After doing some customization on the model, i got 91 millisecond
My PC: 4 cores, 8GB RAM (7 GB for heap)
Does any one suggest me any solution to improve the performance of the benchmark ?
The cache is used is a map with following configuration:
<properties> <property name="hazelcast.jmx">true</property> <property name="hazelcast.query.predicate.parallel.evaluation">true</property> <property name="hazelcast.aggregation.accumulation.parallel.evaluation">true</property>
</properties>
<map name="tasks">
<in-memory-format>BINARY</in-memory-format> <backup-count>1</backup-count> <async-backup-count>0</async-backup-count> <time-to-live-seconds>0</time-to-live-seconds> <max-idle-seconds>0</max-idle-seconds> <eviction-policy>NONE</eviction-policy> <max-size policy="PER_NODE">0</max-size> <eviction-percentage>25</eviction-percentage> <min-eviction-check-millis>100</min-eviction-check-millis> <merge-policy>com.hazelcast.map.merge.PutIfAbsentMapMergePolicy</merge-policy> <cache-deserialized-values>INDEX-ONLY</cache-deserialized-values> <indexes> <index ordered="false">priority</index> <index ordered="false">username</index> <index ordered="false">userGroup</index> <index ordered="false">isPending</index> <index ordered="false">taskDocuments[any].userId</index> <index ordered="false">taskDocuments[any].documentType</index> </indexes> </map>
My aggregator implementation is as following:
extends Aggregator<Entry<String, TaskEntity>, TaskEntity> {
private static final long serialVersionUID = -2586341529070334236L;
private TaskEntity result;
private final TaskInfo taskInfo;
public TaskAggregator(final TaskInfo taskInfo) { this.taskInfo = taskInfo; }
@Override public void accumulate(final Entry<String, TaskEntity> input) { final TaskEntity taskEntity = input.getValue();
if (taskEntity.getIsPending()) { return; }
final String username = taskEntity.getUsername(); if ((username != null) && !username.equals(this.taskInfo.getUsername())) { return; }
if (!this.taskInfo.getUserGroups().stream().anyMatch( userGroup -> userGroup.equals(taskEntity.getUserGroup()))) { return; }
if (taskEntity.getTaskDocuments().stream().anyMatch( taskDocument -> (taskDocument.getUserId() .equals(this.taskInfo.getUsername())) || !taskDocument.getDocumentType() .equals(this.taskInfo.getDocType()))) { return; }
if ((this.result == null) || ((this.result.getPriority() == taskEntity.getPriority()) && (this.result.getCreatedTime() > taskEntity .getCreatedTime())) || (this.result.getPriority() < taskEntity.getPriority())) { this.result = taskEntity; } }
@Override public TaskEntity aggregate() { return this.result; }
@Override public void combine( @SuppressWarnings("rawtypes") final Aggregator aggregator) { final TaskAggregator customAggregator = (TaskAggregator) aggregator; final TaskEntity taskEntity = customAggregator.result;
if ((this.result == null) || ((this.result.getPriority() == taskEntity.getPriority()) && (this.result.getCreatedTime() > taskEntity .getCreatedTime())) || (this.result.getPriority() < taskEntity.getPriority())) { this.result = taskEntity; } }
public TaskEntity getResult() { return this.result; }
}
Thank so much
--
You received this message because you are subscribed to the Google Groups "Hazelcast" group.
To unsubscribe from this group and stop receiving emails from it, send an email to hazelcast+unsubscribe@googlegroups.com.
To post to this group, send email to haze...@googlegroups.com.
Visit this group at https://groups.google.com/group/hazelcast.
To view this discussion on the web visit https://groups.google.com/d/msgid/hazelcast/3af73fa8-5e2b-4eb7-a827-bdc71b5c09ae%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
To unsubscribe from this group and stop receiving emails from it, send an email to hazelcast+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/hazelcast/5c796d97-ecd8-42a0-adc2-56e18bc60daf%40googlegroups.com.
Chris
To unsubscribe from this group and stop receiving emails from it, send an email to hazelcast+unsubscribe@googlegroups.com.
To post to this group, send email to haze...@googlegroups.com.
Visit this group at https://groups.google.com/group/hazelcast.
To view this discussion on the web visit https://groups.google.com/d/msgid/hazelcast/5c796d97-ecd8-42a0-adc2-56e18bc60daf%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "Hazelcast" group.
To unsubscribe from this group and stop receiving emails from it, send an email to hazelcast+unsubscribe@googlegroups.com.
To post to this group, send email to haze...@googlegroups.com.
Visit this group at https://groups.google.com/group/hazelcast.
To view this discussion on the web visit https://groups.google.com/d/msgid/hazelcast/0AFE4C0C-F2D0-438E-BB35-792B1EF43B3D%40googlemail.com.
Chris
To view this discussion on the web visit https://groups.google.com/d/msgid/hazelcast/5c796d97-ecd8-42a0-adc2-56e18bc60daf%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "Hazelcast" group.
To unsubscribe from this group and stop receiving emails from it, send an email to hazelcast+...@googlegroups.com.
To post to this group, send email to haze...@googlegroups.com.
Visit this group at https://groups.google.com/group/hazelcast.
To view this discussion on the web visit https://groups.google.com/d/msgid/hazelcast/0AFE4C0C-F2D0-438E-BB35-792B1EF43B3D%40googlemail.com.
--
You received this message because you are subscribed to the Google Groups "Hazelcast" group.
To unsubscribe from this group and stop receiving emails from it, send an email to hazelcast+...@googlegroups.com.
To post to this group, send email to haze...@googlegroups.com.
Visit this group at https://groups.google.com/group/hazelcast.
To view this discussion on the web visit https://groups.google.com/d/msgid/hazelcast/CAGuAWdDqhC0FeeXat%2BiBGqj-vdHmYeyNy4O_hCaO%2BogcbH1d9Q%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.