mesos-reviews mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Meng Zhu <m...@mesosphere.io>
Subject Re: Review Request 68383: Optimized range addition and parsing operations.
Date Tue, 21 Aug 2018 21:45:55 GMT

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

(Updated Aug. 21, 2018, 2:45 p.m.)


Review request for mesos, Benjamin Mahler, Gastón Kleiman, and Vinod Kone.


Changes
-------

Updated patch with additional optimization. Added test results with benchmark numbers.


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


Repository: mesos


Description
-------

This patch refactored and optimized range addition and
parsing operations by removing redundant copies.


Diffs (updated)
-----

  src/common/values.cpp f04d115d2651da5a2784cb9e76757ecef9e2c118 
  src/tests/values_tests.cpp e4fcf982ac385f58e602eca78765f85485194e41 
  src/v1/values.cpp 1be99459ef8eb427b44f87234d64ebf099cd7866 


Diff: https://reviews.apache.org/r/68383/diff/2/

Changes: https://reviews.apache.org/r/68383/diff/1-2/


Testing (updated)
-------

make check

Benchmarking:

Benchmarked on a Mac with an optimized build, compared "before" and "after". I did not bother
to fix the DVFS on the Mac. Instead, I used subtraction which always runs together with the
addition (thus should have similar frequency setting) as a relative performance reference.

Overall, in "before", the geometric elapsed time of addition is 1.065x of that of subtraction,
in "after" the addition is 1.02x of that of subtraction. So a minor performance improvement.


Before:

[----------] 3 tests from ResourcesRangesSizes/Resources_Ranges_BENCHMARK_Test
[ RUN      ] ResourcesRangesSizes/Resources_Ranges_BENCHMARK_Test.ArithmeticOverlapping/0
Took 6.85608ms to perform 1000 'a += b' operations on ports:[1-6, 11-16, 21-26...91-96] and
ports:[3-8, 13-18, 23-28..., 93-98] with 10 sub-ranges
Took 7.263897ms to perform 1000 'a -= b' operations on ports:[1-6, 11-16, 21-26...91-96] and
ports:[3-8, 13-18, 23-28..., 93-98] with 10 sub-ranges
Took 3.790729ms to perform 1000 'a + b' operations on ports:[1-6, 11-16, 21-26...91-96] and
ports:[3-8, 13-18, 23-28..., 93-98] with 10 sub-ranges
Took 4.206296ms to perform 1000 'a - b' operations on ports:[1-6, 11-16, 21-26...91-96] and
ports:[3-8, 13-18, 23-28..., 93-98] with 10 sub-ranges

Took 23.475893ms to perform 1000 'a += b' operations on ports:[1-6, 11-16, 21-26...991-996]
and ports:[3-8, 13-18, 23-28..., 993-998] with 100 sub-ranges
Took 21.224455ms to perform 1000 'a -= b' operations on ports:[1-6, 11-16, 21-26...991-996]
and ports:[3-8, 13-18, 23-28..., 993-998] with 100 sub-ranges
Took 31.351529ms to perform 1000 'a + b' operations on ports:[1-6, 11-16, 21-26...991-996]
and ports:[3-8, 13-18, 23-28..., 993-998] with 100 sub-ranges
Took 29.955466ms to perform 1000 'a - b' operations on ports:[1-6, 11-16, 21-26...991-996]
and ports:[3-8, 13-18, 23-28..., 993-998] with 100 sub-ranges

Took 228.931943ms to perform 1000 'a += b' operations on ports:[1-6, 11-16, 21-26...9991-9996]
and ports:[3-8, 13-18, 23-28..., 9993-9998] with 1000 sub-ranges
Took 193.494092ms to perform 1000 'a -= b' operations on ports:[1-6, 11-16, 21-26...9991-9996]
and ports:[3-8, 13-18, 23-28..., 9993-9998] with 1000 sub-ranges
Took 366.116822ms to perform 1000 'a + b' operations on ports:[1-6, 11-16, 21-26...9991-9996]
and ports:[3-8, 13-18, 23-28..., 9993-9998] with 1000 sub-ranges
Took 291.755924ms to perform 1000 'a - b' operations on ports:[1-6, 11-16, 21-26...9991-9996]
and ports:[3-8, 13-18, 23-28..., 9993-9998] with 1000 sub-ranges

After:

Took 7.266212ms to perform 1000 'a += b' operations on ports:[1-6, 11-16, 21-26...91-96] and
ports:[3-8, 13-18, 23-28..., 93-98] with 10 sub-ranges
Took 7.81363ms to perform 1000 'a -= b' operations on ports:[1-6, 11-16, 21-26...91-96] and
ports:[3-8, 13-18, 23-28..., 93-98] with 10 sub-ranges
Took 5.38698ms to perform 1000 'a + b' operations on ports:[1-6, 11-16, 21-26...91-96] and
ports:[3-8, 13-18, 23-28..., 93-98] with 10 sub-ranges
Took 6.84771ms to perform 1000 'a - b' operations on ports:[1-6, 11-16, 21-26...91-96] and
ports:[3-8, 13-18, 23-28..., 93-98] with 10 sub-ranges

Took 30.42183ms to perform 1000 'a += b' operations on ports:[1-6, 11-16, 21-26...991-996]
and ports:[3-8, 13-18, 23-28..., 993-998] with 100 sub-ranges
Took 25.640492ms to perform 1000 'a -= b' operations on ports:[1-6, 11-16, 21-26...991-996]
and ports:[3-8, 13-18, 23-28..., 993-998] with 100 sub-ranges
Took 35.90405ms to perform 1000 'a + b' operations on ports:[1-6, 11-16, 21-26...991-996]
and ports:[3-8, 13-18, 23-28..., 993-998] with 100 sub-ranges
Took 41.196565ms to perform 1000 'a - b' operations on ports:[1-6, 11-16, 21-26...991-996]
and ports:[3-8, 13-18, 23-28..., 993-998] with 100 sub-ranges

Took 215.818538ms to perform 1000 'a += b' operations on ports:[1-6, 11-16, 21-26...9991-9996]
and ports:[3-8, 13-18, 23-28..., 9993-9998] with 1000 sub-ranges
Took 164.237836ms to perform 1000 'a -= b' operations on ports:[1-6, 11-16, 21-26...9991-9996]
and ports:[3-8, 13-18, 23-28..., 9993-9998] with 1000 sub-ranges
Took 340.891733ms to perform 1000 'a + b' operations on ports:[1-6, 11-16, 21-26...9991-9996]
and ports:[3-8, 13-18, 23-28..., 9993-9998] with 1000 sub-ranges
Took 300.933864ms to perform 1000 'a - b' operations on ports:[1-6, 11-16, 21-26...9991-9996]
and ports:[3-8, 13-18, 23-28..., 9993-9998] with 1000 sub-ranges


Thanks,

Meng Zhu


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