impala-reviews mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Tim Armstrong (Code Review)" <>
Subject [Impala-ASF-CR] IMPALA-4939, IMPALA-4940: Decimal V2 multiplication
Date Mon, 11 Sep 2017 22:41:12 GMT
Tim Armstrong has posted comments on this change.

Change subject: IMPALA-4939, IMPALA-4940: Decimal V2 multiplication

Patch Set 5:

Commit Message:

Line 75:   DECIMAL_V2 disabled: 4.25s
> Running perf top showed that most of the time is spent in ScaleDownAndRound
Yeah that seems likely - the faster everything else becomes the more this would be a bottleneck.

I don't see an obvious way to speed this up (except maybe avoiding the redundant divide/mod
calls?) and I guess it only makes a difference if a lot of expressions are overflowing. Maybe
someone with deeper knowledge of decimal might see a way to improve it.
File be/src/runtime/decimal-value.inline.h:

Line 204:   if (round) {
It's unfortunate that we're not computing the quotient and remainder at the same time. It
looks like boost eventually calls divide_unsigned_helper in multiprecision/cpp_int/divide.hpp
with the same arguments in both cases but throws away either the result or remainder.

If avoiding two divide calls would help performance we could consider calling divide_unsigned_helper()

To view, visit
To unsubscribe, visit

Gerrit-MessageType: comment
Gerrit-Change-Id: I37ad6232d7953bd75c18dc86e665b2b501a1ebe1
Gerrit-PatchSet: 5
Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-Owner: Taras Bobrovytsky <>
Gerrit-Reviewer: Dan Hecht <>
Gerrit-Reviewer: Michael Ho <>
Gerrit-Reviewer: Taras Bobrovytsky <>
Gerrit-Reviewer: Tim Armstrong <>
Gerrit-Reviewer: Zach Amsden <>
Gerrit-HasComments: Yes

View raw message