You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@impala.apache.org by "Taras Bobrovytsky (JIRA)" <ji...@apache.org> on 2017/12/19 00:33:03 UTC

[jira] [Created] (IMPALA-6344) Optimize decimal multiplication

Taras Bobrovytsky created IMPALA-6344:
-----------------------------------------

             Summary: Optimize decimal multiplication
                 Key: IMPALA-6344
                 URL: https://issues.apache.org/jira/browse/IMPALA-6344
             Project: IMPALA
          Issue Type: Bug
          Components: Backend
            Reporter: Taras Bobrovytsky


Our current implementation of decimal multiplication can be slow and non-optimal due to having branches in our code.

[~zamsden] suggested to use [https://en.wikipedia.org/wiki/Karatsuba_algorithm] multiplication for int128 * int128 -> int256 multiply. The following example implements this and uses 3 hardware 64-bit multiplies to get a full 256 bit result. The code is written in inline assembly and has no branches.
http://coliru.stacked-crooked.com/a/25a697389211189f

We should consider benchmarking this code and using this approach if it turns out to be faster.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)