ITADN

Potential Minor Speedups

#1417OpenPyWoody 创建于 2026-01-21
P
PyWoodycommented
Hi, I've been using `faster-whisper` with great results and I wanted to share the minor tweaks I've made to the library for some slight speed increases. The speed increases are anywhere from 1-5% without any slowdowns. The larger the audio file with a larger amount of text will give bigger speed increases. You can see the tweaks in my branch [here](https://github.com/PyWoody/faster-whisper/tree/speedup). I'd be glad to make a PR of any of the tweaks you want integrated but feel free to do them yourself as they're so minor. The rundown of changes is essentially: only assigning `dtype` once as assigning things in Python is costly, creating `dicts` with `{}` as it is always faster than with `dict()`, and converting `suppress_tokens` to a `set` right off the bat. The last one removed the `list` assertion check but GIGO and assertions are ignored in optimized modes anyway.
3 条评论