mne-tools / mne-features

MNE-Features software for extracting features from multivariate time series
https://mne-tools.github.io/mne-features/
BSD 3-Clause "New" or "Revised" License
142 stars 32 forks source link

Optimizing regexp execution #64

Closed hubertjb closed 3 years ago

hubertjb commented 3 years ago

I noticed the regexps introduced in my last PR (#63) to find channel names in feature strings were pretty slow. In this commit the regexp are compiled once per combination instead. In a quick test with 21 channels and about 2000 features, the overall time taken by the re module went from 14 s to ~3.5 s.

agramfort commented 3 years ago

thx @hubertjb