rhasspy / rhasspy-wake-raven

Wake word detection engine based on Snips Personal Wakeword Detector
MIT License
45 stars 5 forks source link

improve performance of dtw #4

Closed maxbachmann closed 3 years ago

maxbachmann commented 3 years ago

These changes add some performance improvements to the dtw calculation. The main reason for the changes is the preparation for the transition to Cython. This way the actual transition requires less changes (e.g. the matrix access [a,b] can be optimized into direct accesses to the underlying matrix by Cython, which does not work when using the syntax [a][b])

@synesthesiam could you take a quick look at this?

maxbachmann commented 3 years ago

Using the examples provided in the tests these changes lead to the following performance improvements: _compute_optimal_path_with_window: ~20% _compute_optimal_path: ~40% compute_path: ~250%