Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Faster loading #79

Open
pisuke opened this issue Aug 4, 2019 · 2 comments
Open

Faster loading #79

pisuke opened this issue Aug 4, 2019 · 2 comments

Comments

@pisuke
Copy link

pisuke commented Aug 4, 2019

Hi, thanks for this very useful library!
More than an issue, this is a question: is there a way to speed up loading of .SRT files?
I have a use case where I use SRT files to encode lighting events and the files end up being between 50MB and 100MB (they could be much more too).
I would like to check any ideas you might have before moving to a binary format or to start thinking about loading files in chunks.
Thanks!
Francesco

@byroot
Copy link
Owner

byroot commented Aug 4, 2019

I never actually profiled the library, so if you were to do it, you might find a few optimizable hotspots.

Other than that, I can't really think of any huge wins. However if you are parsing huge files, and you don't need it all in memory at once, you'd be better to use the stream API:

def stream(cls, source_file, error_handling=ERROR_PASS):

@pisuke
Copy link
Author

pisuke commented Aug 4, 2019

Thanks for the quick reply!
The stream API looks exactly like what I need, I'll give it a go. :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants