-
-
Notifications
You must be signed in to change notification settings - Fork 3.4k
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
CPU usage spike after upgrading to 3.0.0 #748
Comments
Hi @liri2006 👋 This is more likely a Flutter issue than a bloc issue as bloc v3.0.0 requires Flutter >=v1.12.1. Are you able to compare a counter app with setState and a counter app with bloc to see if the CPU spike only occurs in the bloc variant? Thanks! |
Well, I did compare counter app with and without bloc... and both did not have any issues. And also I'm not able to reproduce it in my main app anymore, so guess it was somehow related to stars alignment, time of a day or just my computer was angry with me for some reason. Sorry for bothering you! |
Hi, noticed the same thing, actually I upgraded from 1.0.0 to 3.0.0 and encountered the issue. Pretty sure it does not come from Flutter and here is why : I checked my
I didn't have time to do further investigations. (Don't have my usb-c adapter with me to profile on device) |
@tenninebt Can you try to downgrade to flutter_bloc 2.1.1 and rxdart 0.22.0? That's what helped me in the morning. Btw, I was initially updating from flutter_bloc 0.21.0. |
I am skeptical that bloc is the issue because there were no major changes to bloc itself. Most of the big changes were in provider and rxdart. If you can provide detailed reproduction steps and have good reason to suspect bloc I'm happy to look into it but given the changes it wouldn't make sense to me. |
Just had a look at |
The dependency should be fine then. flutter_bloc uses |
What I meant is as long as the version is not explicitly constrained, there a risk of other people facing the issue, (if they have an explicit 4.0.0 direct dependency I guess, but maybe in other cases too), forcing the dependency to be ^4.0.1 is safer as they either will have the right version or a conflict when getting the packages, it is clearly not urgent, but nice to have on a next version. |
I'll include this in v3.1.0 👍 |
Published in |
Describe the bug
After upgrading flutter_bloc to 3.0.0 (and rxdart to 0.23.1) I've noticed slight spike in CPU usage by Android Emulator (qemu-system-x86_64.exe process, Windows 10). Immediately after starting the app CPU usage jumps to 40+% and just stays there even though app does nothing.
If downgraded back to 2.1.1 (rxdart to 0.22.0) and restarting the app it falls to 4-5% and everything is ok.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
CPU usage stays low.
Paste the output of running
flutter doctor -v
here.[√] Flutter (Channel beta, v1.12.13+hotfix.6, on Microsoft Windows [Version 10.0.17763.914], locale en-US)
• Flutter version 1.12.13+hotfix.6 at C:\flutter
• Framework revision 18cd7a3601 (2 weeks ago), 2019-12-11 06:35:39 -0800
• Engine revision 2994f7e1e6
• Dart version 2.7.0
[√] Android toolchain - develop for Android devices (Android SDK version 28.0.3)
• Android SDK at C:\Users\amunk\AppData\Local\Android\sdk
• Android NDK location not configured (optional; useful for native profiling support)
• Platform android-28, build-tools 28.0.3
• Java binary at: C:\Program Files\Android\Android Studio\jre\bin\java
• Java version OpenJDK Runtime Environment (build 1.8.0_202-release-1483-b03)
• All Android licenses accepted.
[√] Android Studio (version 3.5)
• Android Studio at C:\Program Files\Android\Android Studio
• Flutter plugin version 42.1.1
• Dart plugin version 191.8593
• Java version OpenJDK Runtime Environment (build 1.8.0_202-release-1483-b03)
[√] VS Code (version 1.41.1)
• VS Code at C:\Users\amunk\AppData\Local\Programs\Microsoft VS Code
• Flutter extension version 3.7.1
[√] Connected device (1 available)
• AOSP on IA Emulator • emulator-5554 • android-x86 • Android 9 (API 28) (emulator)
• No issues found!
The text was updated successfully, but these errors were encountered: