[
https://issues.apache.org/jira/browse/PIRK-40?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15420427#comment-15420427
]
Jacob WIlder commented on PIRK-40:
----------------------------------
I have a working version using GMP for Modular Multiply. Check it out here:
https://github.com/jacobwil/incubator-pirk/tree/JNAGMPForModularMultiply
I'm waiting to make sure I've grabbed all of the places that using GMP gets us
a faster result than Java internal math before making a pull request. Since
these modifications rely on additions to Square's JNA-GMP library (and ideally
they'd make a new release of their library with the required additions) I want
to get everything useful that I want them to include ready before I make a pull
request so we only need to ask once. You can see my changes to JNA-GMP here:
https://github.com/jacobwil/jna-gmp/tree/modularMultiply
Here are preliminary benchmark results:
{code}
Benchmark Mode Cnt Score Error
Units
ModularInverseBenchmark.testWithGMP thrpt 60 9623.954 ± 57.835
ops/s
ModularInverseBenchmark.testWithoutGMP thrpt 60 386.865 ± 2.447
ops/s
ModularMultiplyBenchmark.testWithGMP thrpt 60 34982.751 ± 245.944
ops/s
ModularMultiplyBenchmark.testWithoutGMP thrpt 60 15454.168 ± 95.879
ops/s
{code}
I'm going to look into Suneel's suggestions too. Might be more performance
gains to be had (and different approaches).
> Explore Options to Increase Efficiency of Modular Multiplication
> ----------------------------------------------------------------
>
> Key: PIRK-40
> URL: https://issues.apache.org/jira/browse/PIRK-40
> Project: PIRK
> Issue Type: Improvement
> Reporter: Ellison Anne Williams
> Assignee: Jacob WIlder
>
> We are using JNAGMP (which wraps some operations in GNU's Multiple Precision
> Arithmetic Library) to improve the performance of modular exponentiation; we
> are benchmarking these improvements with the provide benchmark package.
> JNAGMP does not currently provide wrappings for modular multiplication.
> As modular multiplications are one of our most expensive operations, we need
> to explore methods to increase the efficiency.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)