Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

div mod tests #238

Merged
merged 1 commit into from
Jan 12, 2024
Merged

div mod tests #238

merged 1 commit into from
Jan 12, 2024

Conversation

shramee
Copy link
Contributor

@shramee shramee commented Jan 10, 2024

Adds basic tests for div_mod

Pull Request type

Please check the type of change your PR introduces:

  • Bugfix
  • Feature
  • Code style update (formatting, renaming)
  • Refactoring (no functional changes, no API changes)
  • Build-related changes
  • Documentation content changes
  • Other (please describe):

What is the current behavior?

No div_mod test.

What is the new behavior?

Basic div_mod test added.

Does this introduce a breaking change?

  • Yes
  • No

Other information

For 30 / 10 test,

image

@shramee shramee requested a review from 0xLucqs as a code owner January 10, 2024 16:18
@shramee shramee mentioned this pull request Jan 10, 2024
9 tasks
@0xLucqs 0xLucqs merged commit 52abb0d into keep-starknet-strange:main Jan 12, 2024
3 checks passed
0xLucqs pushed a commit that referenced this pull request Jan 12, 2024
<!--- 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. -->
@shramee shramee deleted the div-mod-tests branch January 12, 2024 17:57
@github-actions github-actions bot locked and limited conversation to collaborators Jan 14, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants