Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(725)

Issue 2566733002: Performance optimizations for base/numerics absolute value and multiply (Closed)

Created:
4 years ago by jschuh
Modified:
4 years ago
Reviewers:
scottmg
CC:
chromium-reviews, vmpstr+watch_chromium.org
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Performance optimizations for base/numerics absolute value and multiply Removes a number of branches from the calculations. Also now exporting SafeUnsignedAbs as a public API. NOTRY=true Committed: https://crrev.com/ba3c4f9491c6bbff71f109c508f5a6b9297fe67a Cr-Commit-Position: refs/heads/master@{#437769}

Patch Set 1 #

Patch Set 2 : cleanup #

Patch Set 3 : more shuffling #

Total comments: 4

Patch Set 4 : nits #

Patch Set 5 : one more nit #

Total comments: 1
Unified diffs Side-by-side diffs Delta from patch set Stats (+91 lines, -70 lines) Patch
M base/numerics/safe_conversions.h View 1 2 chunks +4 lines, -0 lines 0 comments Download
M base/numerics/safe_conversions_impl.h View 1 2 3 2 chunks +46 lines, -5 lines 0 comments Download
M base/numerics/safe_math_impl.h View 1 2 3 4 4 chunks +17 lines, -59 lines 1 comment Download
M base/numerics/safe_numerics_unittest.cc View 1 2 4 chunks +24 lines, -6 lines 0 comments Download

Messages

Total messages: 29 (15 generated)
jschuh
ptal
4 years ago (2016-12-09 20:34:07 UTC) #2
scottmg
Apparently VS will do an (a^mask)-mask already https://www.strchr.com/optimized_abs_function, but I guess you found some don't? ...
4 years ago (2016-12-09 22:48:24 UTC) #7
jschuh
> Apparently VS will do an (a^mask)-mask already > https://www.strchr.com/optimized_abs_function, but I guess you found ...
4 years ago (2016-12-09 22:58:05 UTC) #8
scottmg
https://codereview.chromium.org/2566733002/diff/100001/base/numerics/safe_conversions_impl.h File base/numerics/safe_conversions_impl.h (right): https://codereview.chromium.org/2566733002/diff/100001/base/numerics/safe_conversions_impl.h#newcode55 base/numerics/safe_conversions_impl.h:55: typename std::enable_if<!std::is_signed<T>::value>::type* = nullptr> std::is_integral<T>::value && in the enable_if ...
4 years ago (2016-12-09 23:27:02 UTC) #9
jschuh
https://codereview.chromium.org/2566733002/diff/100001/base/numerics/safe_conversions_impl.h File base/numerics/safe_conversions_impl.h (right): https://codereview.chromium.org/2566733002/diff/100001/base/numerics/safe_conversions_impl.h#newcode55 base/numerics/safe_conversions_impl.h:55: typename std::enable_if<!std::is_signed<T>::value>::type* = nullptr> On 2016/12/09 23:27:02, scottmg wrote: ...
4 years ago (2016-12-09 23:31:29 UTC) #10
scottmg
whew. Yeah, OK, I think I convinced myself. lgtm.
4 years ago (2016-12-10 00:26:50 UTC) #11
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2566733002/2
4 years ago (2016-12-10 00:41:08 UTC) #14
scottmg
https://codereview.chromium.org/2566733002/diff/2/base/numerics/safe_math_impl.h File base/numerics/safe_math_impl.h (right): https://codereview.chromium.org/2566733002/diff/2/base/numerics/safe_math_impl.h#newcode188 base/numerics/safe_math_impl.h:188: *result = static_cast<T>((uresult ^ -is_negative) + is_negative); I would ...
4 years ago (2016-12-10 01:01:31 UTC) #15
commit-bot: I haz the power
Try jobs failed on following builders: linux_chromium_compile_dbg_ng on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_compile_dbg_ng/builds/206897)
4 years ago (2016-12-10 03:20:08 UTC) #17
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2566733002/2
4 years ago (2016-12-10 03:21:04 UTC) #19
commit-bot: I haz the power
Try jobs failed on following builders: linux_chromium_rel_ng on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_rel_ng/builds/353841)
4 years ago (2016-12-10 04:52:19 UTC) #21
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2566733002/2
4 years ago (2016-12-10 14:01:04 UTC) #24
commit-bot: I haz the power
Committed patchset #5 (id:2)
4 years ago (2016-12-10 14:04:24 UTC) #27
commit-bot: I haz the power
4 years ago (2016-12-12 15:06:59 UTC) #29
Message was sent while issue was closed.
Patchset 5 (id:??) landed as
https://crrev.com/ba3c4f9491c6bbff71f109c508f5a6b9297fe67a
Cr-Commit-Position: refs/heads/master@{#437769}

Powered by Google App Engine
This is Rietveld 408576698