Closed ChiaMineJP closed 2 years ago
The reason for the difference in pubkey_for_exp
is because clvm
uses bls-signatures
(aka blspy
), and clvm_rs
uses https://github.com/zkcrypto/bls12_381
.
Note that clvm_rs
is now an npm package https://www.npmjs.com/package/clvm_rs containing wasm32. The api is not good yet, but PRs are most welcome. See also https://github.com/Chia-Network/clvm_rs/tree/main/src/wasm. With this code, you may be able to speed up clvm(js)
and clvm_tools(js)
In clvm_rs
, op_point_add
does from_compressed
instead of from_compressed_unchecked
, which is probably a lot slower. However, making this change would probably be a hard fork.
@richardkiss I'll try to import clvm_rs
into clvm_tools-js soon.
I already have an idea on how to integrate clvm_rs into clvm_tools-js.
It is really strange, but I got the same results even I tried benchmark multiple times.
I am releasing production-ready version of clvm_tools-js and I am currently benchmarking to compare performance with:
In summary, clvm in Rust implementation works great in
run_program
. It is around 30-100 times faster than other implementation in most cases. (But be aware,to_sexp_f
benchmark is 5-10 times slower than other implementation. This is another story.)When I got the benchmark result, I found that
op_point_add
is slower than Python implementation ofclvm
. This is really strange. I haven't started investigation yet, but I'd like to share the current data with you.The benchmark was done using benchmark files generated by
costs/generate-benchmark.py
inclvm_tools
. The benchmark parameters are:I modified
generate-benchmrk.py
a bit to produce benchmark files with such parameters. I thought value_size = 4bytes and operations count = 200 seems to be typical among most of chialisp programs.run_program
to_sexp_f
If you are interested, here is the result of
to_sexp_f
benchmark.