Commit Graph

13 Commits

Author SHA1 Message Date
Jacek Sieka 7c81df9adc
fix modmul 256-bit perf (#156)
Not sure about other lengths, but this 100x's 256-bit `modmul` on the
given trivial benchmark and fixes abysmally slow EVM performance

```
Modmul (stint): 856300 ms
```

```
Modmul (stint): 8850 ms
```
2024-07-09 15:35:08 +02:00
Mamy Ratsimbazafy bff69b3f98
Add randomized testing vs GMP 2023-06-12 17:13:35 +07:00
Mamy Ratsimbazafy 27e9c9e441
Add randomized testing, harden against edge cases 2023-06-12 17:12:43 +07:00
Mamy Ratsimbazafy 7efa2483e4
Division/modulo implemented - pass property-based testing vs ttmath 2023-06-12 17:11:13 +07:00
Mamy Ratsimbazafy a46c62bc83
Uint - allow compile-time evaluation for all procs (#54)
* Initial commit - allow all ops at compile-time on uint.

* Update benchmark

* Delete commented ideal version of asWordsiterate, it  is obvious from the workaround (and is tracked in the PR)
2018-06-18 12:54:25 +02:00
Yuriy Glukhov ad09fe3a94 Corrected package structure 2018-05-08 17:42:42 +03:00
Mamy Ratsimbazafy 102a1b0f0c
Rename the library to Stint (#26) 2018-04-25 12:52:00 +02:00
Mamy Ratsimbazafy a2220617a0
update benchmark result 2018-04-21 12:16:26 +02:00
Mamy Ratsimbazafy 1749e0e575
[WIP] Division and multiplication optimization (#21)
* Clean-up code, part 1

* Managed to get best borrow code for the not inlined substraction #10

* Implement in place substraction in terms of substraction #10

* Another unneed proc removal/temporary step

* more cleanup

* Upgrade benchmark to Uint256

* Special case when divisor is less than halfSize x2 speed 🔥 (still 4x slower than ttmath on Uint256)

* Division: special case if dividend can overflow. 10% improvement.

* forgot to undo normalization (why did the test pass :??)

* 1st part, special cases of fast division

* Change bitops, simplify bithacks to detect new fast division cases

* 25% speed increase. Within 3x of ttmath

* Reimplement multiplication with minimum allocation

* Fix call. Now only 2x slower than ttmath

* Prepare for optimizing comparison operators

* Comparison inlining and optimization. 25% speed increase. 50% slower than ttmath now 🔥

* Fix comparison, optimize one()

* inline initMpUintImpl for another 20% speed. Only 20% slower than ttmath without ASM
2018-04-21 12:12:05 +02:00
mratsim 4e12596295 500% division speed increase with bigint twice the size 2018-03-28 20:50:17 +02:00
mratsim 3e84c7e697 Benchmark was slowed down by Nim adding GenericResetAux 2018-03-26 16:16:07 +02:00
mratsim f1935fd673 Improve speed by 90% by inline shr/shl 2018-03-26 14:46:38 +02:00
mratsim 0e7ecaef7a Add bench of modulo op 2018-03-26 12:50:50 +02:00