mate-desktop / mate-calc

Calculator for MATE
http://www.mate-desktop.org
GNU General Public License v2.0
40 stars 33 forks source link

mp-serializer: init MPNumbers outside of loop #191

Closed mbkma closed 3 years ago

mbkma commented 3 years ago

From the MPFR reference manual (https://www.mpfr.org/mpfr-current/#doc):

4.8 Getting the Best Efficiency Out of MPFR

Here are a few hints to get the best efficiency out of MPFR:

• you should avoid allocating and clearing variables. Reuse variables whenever possible, allo-
cate or clear outside of loops, pass temporary variables to subroutines instead of allocating
them inside the subroutines;