@@ -8,43 +8,38 @@ simplicity, accuracy and safety. Clearly not in terms of speed, though,
88given the cdecimal accelerator in Python 3.3+.
99
1010``quicktions `` is an adaptation of the original ``fractions `` module
11- (as included in CPython 3.13a3 ) that is compiled and optimised with
11+ (as included in CPython 3.13 ) that is compiled and optimised with
1212`Cython <https://cython.org/ >`_ into a fast, native extension module.
1313
14- Compared to the standard library ``fractions `` module of CPython,
15- computations in ``quicktions `` are about
14+ Compared to the standard library ``fractions `` module of CPython 3.12 ,
15+ computations in ``quicktions `` are about 3-4x faster.
1616
17- - 10x faster in Python 2.7 and 3.4
18- - 6x faster in Python 3.5
19- - 3-4x faster in Python 3.10
20-
21- Compared to the ``fractions `` module in CPython 3.10, instantiation of a
22- ``Fraction `` in ``quicktions `` is also
17+ Instantiation of a ``Fraction `` in ``quicktions `` is also
2318
2419- 5-15x faster from a floating point string value (e.g. ``Fraction("123.456789") ``)
2520- 3-5x faster from a floating point value (e.g. ``Fraction(123.456789) ``)
26- - 2-4x faster from an integer numerator-denominator pair (e.g. ``Fraction(123, 456) ``)
21+ - 2-5x faster from an integer numerator-denominator pair (e.g. ``Fraction(123, 456) ``)
2722
2823We provide a set of micro-benchmarks here:
2924
3025https://github.com/scoder/quicktions/tree/master/benchmark
3126
32- As of quicktions 1.12 , the different number types and implementations compare
33- as follows in CPython 3.10 :
27+ As of quicktions 1.19 , the different number types and implementations compare
28+ as follows in CPython 3.12 (measured on Ubuntu Linux) :
3429
3530.. code-block ::
3631
3732 Average times for all 'create' benchmarks:
38- float : 36.17 us (1.0x)
39- Decimal : 111.71 us (3.1x )
40- Fraction : 111.98 us (3.1x )
41- PyFraction : 398.80 us (11.0x )
33+ float : 33.55 us (1.0x)
34+ Fraction : 116.02 us (3.5x )
35+ Decimal : 132.22 us (3.9x )
36+ PyFraction : 361.93 us (10.8x )
4237
4338 Average times for all 'compute' benchmarks:
44- float : 4.53 us (1.0x)
45- Decimal : 16.62 us (3.7x )
46- Fraction : 72.91 us (16.1x )
47- PyFraction : 251.93 us (55.6x )
39+ float : 3.24 us (1.0x)
40+ Decimal : 17.28 us (5.3x )
41+ Fraction : 77.04 us (23.8x )
42+ PyFraction : 166.38 us (51.2x )
4843
4944 While not as fast as the C implemented ``decimal `` module in Python 3,
5045``quicktions `` is about 15x faster than the Python implemented ``decimal ``
0 commit comments