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

RF64 Performance #5

Open
janusmiracle opened this issue Oct 2, 2024 · 2 comments
Open

RF64 Performance #5

janusmiracle opened this issue Oct 2, 2024 · 2 comments

Comments

@janusmiracle
Copy link
Owner

The library has a very noticeable delay when dealing with RF64 files.

@janusmiracle
Copy link
Owner Author

janusmiracle commented Oct 3, 2024

The issue stemmed from the excessively large chunks in RF64, particularly the data chunk. In the previous implementation, using stream.read(chunk_size) resulted in a significant loss in performance. The solution was pretty straightforward: since the chunk_data for that chunk was unnecessary, I simply returned an empty string. I skipped the JUNK, FLLR, and PAD chunk data as well. I also introduced an option to ignore ProTool chunks, as I haven't found any documentation on them. This greatly improves performance, especially for RF64 files.

When benchmarked on a 6.26GB ProTools RF64 file, the results were as follows:

['bext', 'fmt ', 'minf', 'elm1', 'data', 'FLLR', 'regn', 'umid', 'DGDA']
0.101348876953125 seconds with ProTools chunk data.
['bext', 'fmt ', 'minf', 'elm1', 'data', 'FLLR', 'regn', 'umid', 'DGDA']
0.002869129180908203 seconds with ProTools chunk data ignored.

For comparison, the previous benchmark for the same file without these performance enhancements was:

['bext', 'fmt ', 'minf', 'elm1', 'data', 'FLLR', 'regn', 'umid', 'DGDA']
2.1404500007629395 seconds.

Instead of using a boolean ignore parameter, it might be more effective to implement an integer setting (or a separate option) to ignore all chunk data not deemed important (e.g. fmt). Alternatively, users could provide a list of chunks to ignore or retain.

@janusmiracle
Copy link
Owner Author

Add an option to output all chunk_data such as data, JUNK, FLLR, etc. Default to False.

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

No branches or pull requests

1 participant