Skip to content

perf: replace list operation with numpy function

Lorenzo Giacomel requested to merge perf-beta-length into master

We improve the performance of the compute_betas_and_lengths function by replacing the line

[all_s.tolist().index(e) for e in set(all_s)]

with

np.unique(all_s, return_index=True)

This line compute the indices of the unique elements of all_s. The new version is faster.

Merge request reports