Beispiel #1
0
 def test():
     """Check if it works.
     """
     print 'pi:', pi_plain(int(1e5))                         #12
     names = ['pi_plain']                                    #13
     total = int(1e5)                                        #14
     repeat = 5                                              #15
     measure_time.measure_run_time(total, names, repeat)     #16
Beispiel #2
0
    def test():
        """Check if it works.
        """

        names = ['pi_plain', 'pi_math']
        total = int(1e5)
        repeat = 5
        measure_time.measure_run_time(total, names, repeat)
Beispiel #3
0
def main():
    """Run all tests that could be found.
    """
    total = int(float(sys.argv[1]))                             #7
    repeat = int(sys.argv[2])                                   #8
    names = ['pi_plain', 'pi_math', 'calc_pi_workers']          #9
    if has_numpy:
        names.extend(['pi_numpy', 'calc_pi_workers_numpy'])     #10
    if has_psyco:
        names.extend(['psyco_pi_plain', 'psyco_pi_math',        #11
                      'psyco_calc_pi_workers'])
        if has_numpy:
            names.extend(['psyco_pi_numpy',
                          'psyco_calc_pi_workers_numpy'])       #12
    measure_time.measure_run_time(total, names, repeat)         #13
Beispiel #4
0
 def test():
     """Time the execution.
     """
     names = ['pi', 'pi_numba_auto', 'pi_numba', 'jitted_pi',
              'jitted_pi_auto']
     measure_time.measure_run_time(int(1e6), names, number=3)