adjoint-io bulletpoofs 性能测试结果

本文详细分析了使用Haskell语言实现的Bulletproofs库在Ubuntu16.04环境下的性能表现,包括范围证明的生成与验证过程的时间消耗,以及各关键函数的资源占用情况。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

https://github.com/adjoint-io/bulletproofs 采用haskell语言编写,haskell为函数式编程语言,对于bulletproofs verify的inner product verify的递归验证契合度很高。

在Ubuntu16.04虚拟机内,1CPU,4G RAM

stack bench

bench 运行结果如下:

bulletproofs> benchmarks
Running 1 benchmarks...
Benchmark rangeproof-benchmarks: RUNNING...
benchmarking Rangeproof/Proving
time                 1.294 s    (1.270 s .. 1.304 s)
                     1.000 R²   (1.000 R² .. 1.000 R²)
mean                 1.277 s    (1.263 s .. 1.285 s)
std dev              13.90 ms   (1.715 ms .. 17.96 ms)
variance introduced by outliers: 19% (moderately inflated)

benchmarking Rangeproof/Verifying
time                 582.4 ms   (506.0 ms .. NaN s)
                     0.998 R²   (0.992 R² .. 1.000 R²)
mean                 595.1 ms   (585.1 ms .. 612.7 ms)
std dev              17.09 ms   (1.266 ms .. 21.99 ms)
variance introduced by outliers: 19% (moderately inflated)

Benchmark rangeproof-benchmarks: FINISH

stack setup 
stack build --library-profiling
stack ghc -- -prof -fprof-auto -rtsopts bench/profiling/Rangeproof.hs -o Rangeproof
./Rangeproof +RTS -p

对应生成的Rangeproof.prof 内容如下:

	Fri Jul  5 09:54 2019 Time and Allocation Profiling Report  (Final)

	   Rangeproof +RTS -p -RTS

	total time  =        4.09 secs   (4095 ticks @ 1000 us, 1 processor)
	total alloc = 1,159,332,240 bytes  (excludes profiling overheads)

COST CENTRE          MODULE                      SRC                                            %time %alloc

gmpInverse.r         Crypto.Number.Compat        Crypto/Number/Compat.hs:95:9-31                 44.0    4.6
divmod               Crypto.PubKey.ECC.Prim      Crypto/PubKey/ECC/Prim.hs:(173,1)-(175,26)      14.0   19.4
pointDouble.yr       Crypto.PubKey.ECC.Prim      Crypto/PubKey/ECC/Prim.hs:83:9-47                9.1   15.4
pointDouble.xr       Crypto.PubKey.ECC.Prim      Crypto/PubKey/ECC/Prim.hs:82:9-50                7.5   11.6
pointDouble          Crypto.PubKey.ECC.Prim      Crypto/PubKey/ECC/Prim.hs:(79,1)-(93,20)         6.0   14.7
pointAdd.yr          Crypto.PubKey.ECC.Prim      Crypto/PubKey/ECC/Prim.hs:52:13-46               5.2   10.4
pointAdd.xr          Crypto.PubKey.ECC.Prim      Crypto/PubKey/ECC/Prim.hs:51:13-50               4.8    8.1
pointAdd             Crypto.PubKey.ECC.Prim      Crypto/PubKey/ECC/Prim.hs:(42,1)-(60,20)         2.8    6.2
pointAddTwoMuls.go.q Crypto.PubKey.ECC.Prim      Crypto/PubKey/ECC/Prim.hs:133:13-59              1.4    3.5
pointAddTwoMuls.go   Crypto.PubKey.ECC.Prim      Crypto/PubKey/ECC/Prim.hs:(131,5)-(138,33)       1.3    0.7
pointMul             Crypto.PubKey.ECC.Prim      Crypto/PubKey/ECC/Prim.hs:(105,1)-(111,58)       1.3    1.4
gmpInverse           Crypto.Number.Compat        Crypto/Number/Compat.hs:(92,1)-(95,31)           0.5    1.5
inverse              Crypto.Number.ModArithmetic Crypto/Number/ModArithmetic.hs:(80,1)-(85,22)    0.3    1.5


                                                                                                                                                                            individual      inherited
COST CENTRE                                         MODULE                                  SRC                                                        no.       entries  %time %alloc   %time %alloc

MAIN                                                MAIN                                    <built-in>                                                  3336          0    0.0    0.0   100.0  100.0
 CAF                                                Bulletproofs.Curve                      <entire-module>                                             6671          0    0.0    0.0     9.0    8.9
  _p                                                Bulletproofs.Curve                      Bulletproofs/Curve.hs:(92,1)-(96,49)                        6973          1    0.0    0.0     0.0    0.0
   _p.cp                                            Bulletproofs.Curve                      Bulletproofs/Curve.hs:(94,5)-(96,49)                        6975          1    0.0    0.0     0.0    0.0
   ecc_p                                            Crypto.PubKey.ECC.Types                 Crypto/PubKey/ECC/Types.hs:77:1-26                          6974          1    0.0    0.0     0.0    0.0
   。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值