-
Notifications
You must be signed in to change notification settings - Fork 339
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
Unneded string interpolation of characteristics is very resource hungry #708
Comments
if you set |
Hi @Taym95, the issue is, that even when setting the Can you please reopen this ticket and also think about merging my PR #861? |
I noticed the same issue a few lines below. Our app is permanently scanning for Bluetooth devices and this is actually a big part of the used CPU! flutter_reactive_ble/packages/reactive_ble_mobile/lib/src/reactive_ble_mobile_platform.dart Lines 70 to 72 in 9aa9957
|
Hi @BenelliFurtado, yes that's the same issue. I am currently working on it and it seems my PR will be merged soon. |
The logger output in
reactive_ble_mobile_platform.dart
, is evaluated for each received message. Especially the interpolation of the characteristic is quite resource hungry. We are receiving a lot of characteristics data and this string interpolation takes up about 10-15% of CPU usage for our data handling.flutter_reactive_ble/packages/reactive_ble_mobile/lib/src/reactive_ble_mobile_platform.dart
Lines 59 to 61 in 9aa9957
Unfortunately the logger is always initialized via the following code and I don't see any way to disable it.
flutter_reactive_ble/packages/flutter_reactive_ble/lib/src/reactive_ble.dart
Lines 100 to 105 in 9aa9957
Can this be refactored, that the logger does not have to be initialized and can be set to
null
if not used? AFAIK then the interpolation would not be executed, resulting in less CPU usage.The text was updated successfully, but these errors were encountered: