mesos-reviews mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Guangya Liu <gyliu...@gmail.com>
Subject Re: Review Request 50017: Do not validate resource when add/subtract `Resources` object.
Date Wed, 20 Jul 2016 03:22:43 GMT

-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/50017/
-----------------------------------------------------------

(Updated 七月 20, 2016, 3:22 a.m.)


Review request for mesos, Benjamin Mahler and Klaus Ma.


Summary (updated)
-----------------

Do not validate resource when add/subtract `Resources` object.


Bugs: MESOS-5869
    https://issues.apache.org/jira/browse/MESOS-5869


Repository: mesos


Description (updated)
-------

Do not validate resource when add/subtract `Resources` object.


Diffs (updated)
-----

  include/mesos/resources.hpp a557e97c65194d4aad879fb88d8edefd1c95b8d8 
  include/mesos/v1/resources.hpp a5ba8fec4c9c3643646308f75a4b28cefe0b3df3 
  src/common/resources.cpp b1bd2784aefdebf91892638b40b215373b998574 
  src/v1/resources.cpp 6d4ec75fbb7edab013563142aaf13d5302cc50af 

Diff: https://reviews.apache.org/r/50017/diff/


Testing (updated)
-------

The `qcachegrind` result here: https://docs.google.com/document/d/1oilen04e8trIOgYbj-jxAd7esTRDaySll8y2BQ6p5nU/edit?usp=sharing

Based on the test, 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:
```
[==========] 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.
```

Sorter Benchmark test after fix:
```
[==========] 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.
```

Ports resources benchmark test before fix:
```
[==========] 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.
```

Ports resources benchmark test after fix:
```
[==========] 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.
```


Thanks,

Guangya Liu


Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message