Skip to content

Potential Minor Speedups #1417

@PyWoody

Description

@PyWoody

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. 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions