mathics / Mathics

This repository is for archival. Please see https://github.com/Mathics3/mathics-core
https://mathics.org
Other
2.08k stars 208 forks source link

Improve Rational performance #1570

Closed TiagoCavalcante closed 2 years ago

TiagoCavalcante commented 2 years ago

The benchmark:

Mathics git repo /workspaces/mathics-benchmark/Mathics at 58dc69
10000 iterations of Rational...
  1.312635 secs for: Rational[10, 1]                         
  1.235519 secs for: Rational[2, 3]                          

Mathics git repo /workspaces/mathics-benchmark/Mathics at b9b11b
10000 iterations of Rational...
  1.199198 secs for: Rational[10, 1]                         
  1.159303 secs for: Rational[2, 3]

Way more important than that tenth of second is that there is a lot of places where instead of .to_sympy() we could use the faster .value.