Guangya Liu created MESOS-5869:
----------------------------------

             Summary: Disable resources validation for `+=` and `-=`
                 Key: MESOS-5869
                 URL: https://issues.apache.org/jira/browse/MESOS-5869
             Project: Mesos
          Issue Type: Bug
            Reporter: Guangya Liu
            Assignee: Guangya Liu


The `validation` consumed quite a lot of time when doing resources `+=` and 
`-=`, but it is not needed for those operations, we need to remove this check.

Based on the test result of removing the `validation`, the performance of 
resources += and -= will be improved by 10x for sorter test, and the 
performance for port range += was improved by 5x and port range -= was improved 
1000x.

Sorter Benchmark test before fix:
{code}
[==========] Running 1 test from 1 test case.
[----------] Global test environment set-up.
[----------] 1 test from AgentAndClientCount/Sorter_BENCHMARK_Test
[ RUN      ] AgentAndClientCount/Sorter_BENCHMARK_Test.FullSort/35
Using 50000 agents and 1000 clients
Added 1000 clients in 23305us
Added 50000 agents in 1.174069secs
Added allocations for 50000 agents in 40.562802secs
Full sort of 1000 clients took 38193us
No-op sort of 1000 clients took 382us
[       OK ] AgentAndClientCount/Sorter_BENCHMARK_Test.FullSort/35 (43032 ms)
[----------] 1 test from AgentAndClientCount/Sorter_BENCHMARK_Test (43032 ms 
total)

[----------] Global test environment tear-down
[==========] 1 test from 1 test case ran. (43054 ms total)
[  PASSED  ] 1 test.
{code}

Sorter Benchmark test after fix:
{code}
[==========] Running 1 test from 1 test case.
[----------] Global test environment set-up.
[----------] 1 test from AgentAndClientCount/Sorter_BENCHMARK_Test
[ RUN      ] AgentAndClientCount/Sorter_BENCHMARK_Test.FullSort/35
Using 50000 agents and 1000 clients
Added 1000 clients in 25846us
Added 50000 agents in 1.092462secs
Added allocations for 50000 agents in 4.397859secs
Full sort of 1000 clients took 35051us
No-op sort of 1000 clients took 551us
[       OK ] AgentAndClientCount/Sorter_BENCHMARK_Test.FullSort/35 (6897 ms)
[----------] 1 test from AgentAndClientCount/Sorter_BENCHMARK_Test (6897 ms 
total)

[----------] Global test environment tear-down
[==========] 1 test from 1 test case ran. (6920 ms total)
[  PASSED  ] 1 test.
{code}

Ports resources benchmark test before fix:
{code}
[==========] Running 1 test from 1 test case.
[----------] Global test environment set-up.
[----------] 1 test from ResourcesOperators/Resources_BENCHMARK_Test
[ RUN      ] ResourcesOperators/Resources_BENCHMARK_Test.Arithmetic/2
Took 12.478841secs to perform 1000 'total += r' operations on ports(*):[1-2, 
4-5, 7-8, 10-11, 13-14, 16-17, 1...
Took 8.512399secs to perform 1000 'total -= r' operations on ports(*):[1-2, 
4-5, 7-8, 10-11, 13-14, 16-17, 1...
Took 11.296542secs to perform 1000 'total = total + r' operations on 
ports(*):[1-2, 4-5, 7-8, 10-11, 13-14, 16-17, 1...
Took 8.517692secs to perform 1000 'total = total - r' operations on 
ports(*):[1-2, 4-5, 7-8, 10-11, 13-14, 16-17, 1...
[       OK ] ResourcesOperators/Resources_BENCHMARK_Test.Arithmetic/2 (40808 ms)
[----------] 1 test from ResourcesOperators/Resources_BENCHMARK_Test (40808 ms 
total)

[----------] Global test environment tear-down
[==========] 1 test from 1 test case ran. (40832 ms total)
[  PASSED  ] 1 test.
{code}

Ports resources benchmark test after fix:
{code}
[==========] Running 1 test from 1 test case.
[----------] Global test environment set-up.
[----------] 1 test from ResourcesOperators/Resources_BENCHMARK_Test
[ RUN      ] ResourcesOperators/Resources_BENCHMARK_Test.Arithmetic/2
Took 2.827012secs to perform 1000 'total += r' operations on ports(*):[1-2, 
4-5, 7-8, 10-11, 13-14, 16-17, 1...
Took 8841us to perform 1000 'total -= r' operations on ports(*):[1-2, 4-5, 7-8, 
10-11, 13-14, 16-17, 1...
Took 3.313112secs to perform 1000 'total = total + r' operations on 
ports(*):[1-2, 4-5, 7-8, 10-11, 13-14, 16-17, 1...
Took 12415us to perform 1000 'total = total - r' operations on ports(*):[1-2, 
4-5, 7-8, 10-11, 13-14, 16-17, 1...
[       OK ] ResourcesOperators/Resources_BENCHMARK_Test.Arithmetic/2 (6164 ms)
[----------] 1 test from ResourcesOperators/Resources_BENCHMARK_Test (6164 ms 
total)

[----------] Global test environment tear-down
[==========] 1 test from 1 test case ran. (6187 ms total)
[  PASSED  ] 1 test.
{code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to