-
Notifications
You must be signed in to change notification settings - Fork 243
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
skip_duration takes ~600ms to run #338
Comments
It's runnning the entire decoder in the background, and is faster than realtime at that. If you want to decode something more quickly, you can enable optimizations for your dependencies through cargo profile dependencies. Sadly there is no cargo option yet for the dependencies to enable them themselves. This should greatly improve stuff for you: [profile.dev.overrides."lewton"]
opt-level = 3 |
@est31 Ah ok nice. How do I use that though? I tried adding it to my Cargo.toml but the results are the same (600ms) and when I compile I get a warning saying |
Oh sorry the syntax has been changed. Needs to be: [profile.dev.overrides."lewton"]
opt-level = 3 See: https://doc.rust-lang.org/cargo/reference/profiles.html#overrides |
@est31 Ah great, it's actually (for anyone else who might come here):
But, that still only reduced it to 200ms, which still seems like a lot? (But I'm completely unfamiliar with how this works so could be that that's a hard limit) |
@FredrikNoren lol sorry, I forgot to edit it, just copy pasted it. Yes, indeed that's what I meant. You could also try adding such sections for crates like rodio, ogg, or just replace the "lewton" entirely with "*" to get all dependencies optimized. |
@est31 I tried it in release mode now, and even there it's 20ms. Going to try to see if I can buffer it somehow and see if it can get faster. |
I tried this: #141 (comment) But it actually made it a bit slower; 24ms in release mode. 215ms in debug (with opt-level 3). |
@FredrikNoren if you really want extremely small overhead, you'll need seeking support which rodio currently doesn't support. |
@est31 Hm ok. What's missing for seeking support? |
@FredrikNoren backend support, see #176 |
Hi,
I'm playing around with rodio for a project, and I noticed I got freeze lags when I was playing some sounds. After some digging it turned out that the culprit was calling skip_duration on a source. It seems like it gets worse the longer the skip is. This is in debug mode, but skipping 3secs takes 600ms to run for me which seems a bit extreme. This is on OSX.
To repro, just take the first example in the docs and add skip_duration to it, like this:
Results on my machine (in debug):
The text was updated successfully, but these errors were encountered: