Comments (5)
Weeding out the zeros does look tricky, though maybe it's worth benchmarking if it's worthwhile? One way to do it would be to make a copy of p
(and coeffs
), then make a single pass over it swapping any zeros (and the corresponding coeff) with the last element.
from c-kzg-4844.
Wrote a unittest that demonstrates the bug: 8b7ef36
And a demontration of the simple fix: 84c9ef9
Marked the PR as draft for now. Will give a shot at the "weed out zeroes" approach later.
from c-kzg-4844.
Weeding out the zeros does look tricky, though maybe it's worth benchmarking if it's worthwhile? One way to do it would be to make a copy of
p
(andcoeffs
), then make a single pass over it swapping any zeros (and the corresponding coeff) with the last element.
I did not feel smart enough to do the swapping strategy, so I implemented a more naive weeding out strategy here: asn-d6@42f6e18 That was a quick implementation for benchmarking; the logic is a bit dicey so there might be bugs.
The benefits of the weeding out strategy start to be visible in batch verify with n=16 where we get an 8% speed boost, and at n=32 we get a 10% speed boost. For smaller n the performance is almost identical (after all we always do the naive MSM for n < 8).
My intuition tells me to go with the simple strategy of #140 upstream for now, and if this performance ever becomes problematic we can switch to the more involved weeding out strategy. After all, IIUC we mainly care for mempool verification performance where transactions are not gonna have multiple blobs.
from c-kzg-4844.
Here is a proper implementation of the weed out strategy: #156
I would appreciate a review here as this significantly complicates the logic of g1_lincomb()
/cc @jtraglia @xrchz @dankrad
from c-kzg-4844.
Closing this in favor of #156 (comment)
from c-kzg-4844.
Related Issues (20)
- Test hard-wired to 4096, no check for FIELD_ELEMENTS_PER_BLOB not a power of 2. HOT 3
- Double check handling of trusted setup by bindings HOT 8
- Intermittent CI failure with build-ckzg-dotnet HOT 6
- File descriptor leak in the nodejs bindings HOT 1
- Rust benchmarks are broken HOT 2
- Consider using a char buffer instead of FILE HOT 5
- Can I just compile as a lib in C? HOT 3
- Some ops seem exceedingly slow on Apple M2 HOT 11
- Crashes with SIGILL on Linux/amd64 i7 CPU HOT 3
- Add library prefix to all ckzg symbols HOT 7
- Broken CI in rust-windows because of rust-1.7.0 HOT 1
- Stack overflow in Rust benchmarks on Windows HOT 1
- Nodejs does not support browsers HOT 5
- Problems with cross-platform docker images HOT 6
- Release Rust bindings on crates.io HOT 3
- Support new function ckzg_load_trusted_setup_from_bytes HOT 3
- Should we make FIELD_ELEMENTS_PER_BLOB runtime-configurable? HOT 8
- Rust binding can't cross compile on Apple Silicon HOT 3
- Rust bindings lack flexibility with current structure of build script HOT 3
- Rust build.rs: Pass -D__BLST_NO_ASM__ on non-x86-64/non-aarch64 ISAs HOT 7
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from c-kzg-4844.