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

Creating AudioData and FFTData Wrapper Objects Wastes CPU #20

Open
ResonantCavity opened this issue Dec 25, 2015 · 0 comments
Open

Creating AudioData and FFTData Wrapper Objects Wastes CPU #20

ResonantCavity opened this issue Dec 25, 2015 · 0 comments

Comments

@ResonantCavity
Copy link

I was able to significantly reduce CPU overhead in my app by ripping out AudioData and passing a byte[] directly to the renderer. On an N7, CPU went from a steady 40% to 30%, which includes some complex audio processing that app does. Creating all of those objects in a tight loop is going to impose significant costs because of the work to instantiate the object and to garbage collect it.

If the goal of overloading render() is to have different method signatures for time-domain vs. frequency domain signals, just change the names of the methods to renderWaveform() and renderFFT().

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

0 participants