• Stefan Behnel's avatar
    bpo-35588: Speed up mod, divmod and floordiv operations for Fraction type (#11322) · 3a374e0c
    Stefan Behnel yazdı
    * bpo-35588: Implement mod and divmod operations for Fraction type by spelling out the numerator/denominator calculation, instead of instantiating and normalising Fractions along the way. This speeds up '%' and divmod() by 2-3x.
    
    * bpo-35588: Also reimplement Fraction.__floordiv__() using integer operations to make it ~4x faster.
    
    * Improve code formatting.
    Co-Authored-By: 's avatarscoder <stefan_ml@behnel.de>
    
    * bpo-35588: Fix return type of divmod(): the result of the integer division should be an integer.
    
    * bpo-35588: Further specialise __mod__() and inline the original helper function _flat_divmod() since it's no longer reused.
    
    * bpo-35588: Add some tests with large numerators and/or denominators.
    
    * bpo-35588: Use builtin "divmod()" function for implementing __divmod__() in order to simplify the implementation, even though performance results are mixed.
    
    * Rremove accidentally added empty line.
    
    * bpo-35588: Try to provide more informative output on test failures.
    
    * bpo-35588: Improve wording in News entry.
    Co-Authored-By: 's avatarscoder <stefan_ml@behnel.de>
    
    * Remove stray space.
    3a374e0c
Adı
Son kayıt (commit)
Son güncelleme
.azure-pipelines Loading commit data...
.github Loading commit data...
Doc Loading commit data...
Grammar Loading commit data...
Include Loading commit data...
Lib Loading commit data...
Mac Loading commit data...
Misc Loading commit data...
Modules Loading commit data...
Objects Loading commit data...
PC Loading commit data...
PCbuild Loading commit data...
Parser Loading commit data...
Programs Loading commit data...
Python Loading commit data...
Tools Loading commit data...
m4 Loading commit data...
.gitattributes Loading commit data...
.gitignore Loading commit data...
.travis.yml Loading commit data...
CODE_OF_CONDUCT.md Loading commit data...
LICENSE Loading commit data...
Makefile.pre.in Loading commit data...
README.rst Loading commit data...
aclocal.m4 Loading commit data...
config.guess Loading commit data...
config.sub Loading commit data...
configure Loading commit data...
configure.ac Loading commit data...
install-sh Loading commit data...
pyconfig.h.in Loading commit data...
setup.py Loading commit data...