[
https://issues.apache.org/jira/browse/MESOS-5700?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15381362#comment-15381362
]
Klaus Ma commented on MESOS-5700:
---------------------------------
Did more test based on the Resources benchmark:
1. make Resource's name & role to be enum/int will improve 400ms per 10
operator on 1000 resource.
2. using hashmap in Resources will improve 2 s per 10 operator on 4000
resource; it should be more improved if using name + role as key. The overhead
of hash map is 70ms per 5000 operators on 4 resources.
Please refer to the attachment for the code diff I used.
*Test result for Resource's name & role*:
Using name() & role() in {{addable()}}
{code}
Took 577.479396ms to perform 10 'total += r' operations on cpus(role_0,
principal_0, {key_0: value_0}):1; ...
Took 647.031984ms to perform 10 'total -= r' operations on cpus(role_0,
principal_0, {key_0: value_0}):1; ...
Took 620.093549ms to perform 10 'total = total + r' operations on cpus(role_0,
principal_0, {key_0: value_0}):1; ...
Took 693.93056ms to perform 10 'total = total - r' operations on cpus(role_0,
principal_0, {key_0: value_0}):1; ...
{code}
without name() but with role() in {{addable()}}
{code}
Took 279.432157ms to perform 10 'total += r' operations on cpus(role_0,
principal_0, {key_0: value_0}):1; ...
Took 647.879612ms to perform 10 'total -= r' operations on cpus(role_0,
principal_0, {key_0: value_0}):1; ...
Took 323.552389ms to perform 10 'total = total + r' operations on cpus(role_0,
principal_0, {key_0: value_0}):1; ...
Took 682.131788ms to perform 10 'total = total - r' operations on cpus(role_0,
principal_0, {key_0: value_0}):1; ...
{code}
without name() and with role_id() in {{addable()}}
{code}
Took 175.373644ms to perform 10 'total += r' operations on cpus(0, principal_0,
{key_0: value_0}):1; cpus(...
Took 598.86704ms to perform 10 'total -= r' operations on cpus(0, principal_0,
{key_0: value_0}):1; cpus(...
Took 222.053999ms to perform 10 'total = total + r' operations on cpus(0,
principal_0, {key_0: value_0}):1; cpus(...
Took 616.455333ms to perform 10 'total = total - r' operations on cpus(0,
principal_0, {key_0: value_0}):1; cpus(...
{code}
*Test result for hash map for Resources*:
With cpus/gpus/disk
{code}
Took 4.396598secs to perform 10 'total += r' operations on cpus(0, principal_0,
{key_0: value_0}):1; gpus(...
Took 4.73346secs to perform 10 'total -= r' operations on cpus(0, principal_0,
{key_0: value_0}):1; gpus(...
Took 4.437688secs to perform 10 'total = total + r' operations on cpus(0,
principal_0, {key_0: value_0}):1; gpus(...
Took 4.940758secs to perform 10 'total = total - r' operations on cpus(0,
principal_0, {key_0: value_0}):1; gpus(...
{code}
Using map for operator+=
{code}
Took 2.469885secs to perform 10 'total += r' operations on cpus(0, principal_0,
{key_0: value_0}):1; gpus(...
Took 4.806674secs to perform 10 'total -= r' operations on cpus(0, principal_0,
{key_0: value_0}):1; gpus(...
Took 3.0442secs to perform 10 'total = total + r' operations on cpus(0,
principal_0, {key_0: value_0}):1; gpus(...
Took 3.278178secs to perform 10 'total = total - r' operations on cpus(0,
principal_0, {key_0: value_0}):1; gpus(...
{code}
> Benchmark for Resource class (protobuf vs. C++)
> -----------------------------------------------
>
> Key: MESOS-5700
> URL: https://issues.apache.org/jira/browse/MESOS-5700
> Project: Mesos
> Issue Type: Bug
> Reporter: Klaus Ma
> Assignee: Klaus Ma
> Attachments: port.perf.log, reservation.perf.log
>
>
> Add benchmark of Resource class for Allocation Performance.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)