1b46c1cb1650ef0b332cd2e3a84b3c0e4a764975,dipy/tracking/benchmarks/bench_streamline.py,,bench_length,#,55

Before Change



def bench_length():
    repeat = 1
    nb_points_per_streamline = 100
    nb_streamlines = int(1e5)
    streamlines = [np.random.rand(nb_points_per_streamline,
                                  3).astype("float32")
                   for i in range(nb_streamlines)]

    print("Timing length() in Cython ({0} streamlines)".format(nb_streamlines))
    cython_time = measure("length(streamlines)", repeat)
    print("Cython time: {0:.3}sec".format(cython_time))
    del streamlines

    streamlines = [np.random.rand(nb_points_per_streamline,
                                  3).astype("float32")
                   for i in range(nb_streamlines)]
    python_time = measure("[length_python(s) for s in streamlines]", repeat)
    print("Python time: {0:.2}sec".format(python_time))
    print("Speed up of {0}x".format(python_time/cython_time))
    del streamlines

After Change


    print("Speed up of {0:.2f}x".format(python_time/cython_time))

    streamlines = DATA["streamlines_arrseq"]
    cython_time_arrseq = measure("length(streamlines)", repeat)
    print("Cython time (ArraySequence): {0:.3}sec".format(cython_time_arrseq))
    print("Speed up of {0:.2f}x".format(python_time/cython_time_arrseq))

    // Make sure all methods produce the same results.
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 4

Instances


Project Name: nipy/dipy
Commit Name: 1b46c1cb1650ef0b332cd2e3a84b3c0e4a764975
Time: 2017-01-07
Author: marc.cote.19@gmail.com
File Name: dipy/tracking/benchmarks/bench_streamline.py
Class Name:
Method Name: bench_length


Project Name: nipy/dipy
Commit Name: d7dcfeeb5b50fc3f9cf670b2b148efafef0ad3b7
Time: 2017-10-05
Author: marc.cote.19@gmail.com
File Name: dipy/tracking/benchmarks/bench_streamline.py
Class Name:
Method Name: bench_set_number_of_points


Project Name: quantumlib/Cirq
Commit Name: d848611149d110c47ab611d7e690e29d1f0adce2
Time: 2020-07-31
Author: henrique.silverio@tecnico.ulisboa.pt
File Name: cirq/pasqal/pasqal_sampler_test.py
Class Name:
Method Name: test_run_sweep