Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
<!--- Please provide a general summary of your changes in the title above --> ## Pull Request type Optimisations for mod arithmetics. Please check the type of change your PR introduces: - [ ] Bugfix - [ ] Feature - [ ] Code style update (formatting, renaming) - [x] Refactoring (no functional changes, no API changes) - [ ] Build-related changes - [ ] Documentation content changes - [ ] Other (please describe): ## What is the current behavior? Mod operations not as fast as they can be. Issue Number: N/A ## What is the new behavior? >⚠️ `div_mod` test included here is added in PR #238 ``` DIVISION OPTIMISATION (from core::math functions) // div_mod_test BEFORE gas usage est.: 97351914 // div_mod_test BEFORE gas usage est.: 277900 MINOR optimisations (from inline) // add_mod_1_test BEFORE gas usage est.: 163180 // add_mod_1_test AFTER gas usage est.: 159880 // add_mod_2_test BEFORE gas usage est.: 109020 // add_mod_2_test AFTER gas usage est.: 106820 // add_mod_p_test BEFORE gas usage est.: 433980 // add_mod_p_test AFTER gas usage est.: 425180 // mult_mod_1_test BEFORE gas usage est.: 455340 // mult_mod_1_test AFTER gas usage est.: 444940 // mult_mod_2_test BEFORE gas usage est.: 455340 // mult_mod_2_test AFTER gas usage est.: 444940 // mult_mod_test BEFORE gas usage est.: 455340 // mult_mod_test AFTER gas usage est.: 444940 // sub_mod_1_test BEFORE gas usage est.: 330380 // sub_mod_1_test AFTER gas usage est.: 319980 // sub_mod_2_test BEFORE gas usage est.: 330380 // sub_mod_2_test AFTER gas usage est.: 319980 // sub_mod_test BEFORE gas usage est.: 356100 // sub_mod_test AFTER gas usage est.: 346300 ``` ## Does this introduce a breaking change? - [ ] Yes - [x] No <!-- If this does introduce a breaking change, please describe the impact and migration path for existing applications below. --> ## Other information <!-- Any other information that is important to this PR, such as screenshots of how the component looks before and after the change. -->
- Loading branch information