如何使用 Android 处理来提高性能?
我已将一些处理草图转换为 Android 应用程序,但它们在模拟器和 我的设备。
关于如何提高作为 Android 应用程序运行的草图的速度和性能,有什么建议吗?我应该避免处理 API 中的某些内容或部分吗?
I have converted a few of my Processing sketches into Android apps, but they seem to run really slowly in the emulator and on my device.
Are there any tips on how to increase the speed and performance of my sketch running as an Android app? Are there things or parts of the Processing API I should avoid?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
http://developer.android.com/guide/practices/design/performance.html
我希望这对你有帮助。
http://developer.android.com/guide/practices/design/performance.html
I hope that helps you.
面对所有答案...他们的答案是为需要优化 CPU 的每一% 的程序员提供的。但我和你有同样的问题,草图中并没有太多内容,但它仍然很慢。我怀疑 BlackDragon 甚至不知道“处理”是什么
我的答案:
尝试使用不同的渲染器,
例如 P2D。
您可以通过将其放在草图尺寸定义旁边来使用它:
或者如果您不想使用该功能,您可以通过放置此方法来覆盖 sketchRenderer。
Facepalm to all answers...Their answers are for programmers that need every single % of the CPU optimized. But I have the same issue as you, not really having much going on in the sketch, but it's still slow. And I doubt BlackDragon even knows what Processing is
My answer:
Try using a different renderer,
P2D for example.
You can use it by putting it next to the sketch size definition:
Or if you don't want to use that function, you can override the sketchRenderer by placing this method.