You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The logging library does a lot even when logging is disabled (or partially enabled) and increases the memory footprint of RxAndroidBle for no particular reason. The same issue has been fixed in the library RxBleLog is based on.
Preconditions
Set log level other than VERBOSE
Steps to reproduce actual result
Communicate with a ble device.
Actual result
There are numerous log calls which is great. But even when log level is set to Error or None in production, log messages are created and waste a lot of cpu cycles and ram.
Eg: RxBleGattCallback.onCharacteristicWrite() calls RxBleLog.d("onCharacteristicWrite characteristic=%s status=%d", characteristic.getUuid(), status);
which in turn calls throwShade(Log.DEBUG, formatString(message, args), null); which calls formatString even though the message will not be logged.
and lastly throwShade discards the message.
Expected result
in RxBleLog the call to formatString should be inside throwShade and after the check for logging level.
The point is that a lot of work is done without a reason. One can argue that its only strings being created, but since VERBOSE and DEBUG also use this, it can easily waste a big amount of cpu cycles on applications with a lot of communication with ble devices.
The logging library this is based on, Timber, has this fixed.
The text was updated successfully, but these errors were encountered:
Summary
The logging library does a lot even when logging is disabled (or partially enabled) and increases the memory footprint of RxAndroidBle for no particular reason. The same issue has been fixed in the library
RxBleLog
is based on.Preconditions
Set log level other than
VERBOSE
Steps to reproduce actual result
Communicate with a ble device.
Actual result
There are numerous log calls which is great. But even when log level is set to
Error
orNone
in production, log messages are created and waste a lot of cpu cycles and ram.Eg:
RxBleGattCallback.onCharacteristicWrite()
callsRxBleLog.d("onCharacteristicWrite characteristic=%s status=%d", characteristic.getUuid(), status);
which in turn calls
throwShade(Log.DEBUG, formatString(message, args), null);
which callsformatString
even though the message will not be logged.and lastly
throwShade
discards the message.Expected result
in
RxBleLog
the call toformatString
should be insidethrowShade
and after the check for logging level.The point is that a lot of work is done without a reason. One can argue that its only strings being created, but since
VERBOSE
andDEBUG
also use this, it can easily waste a big amount of cpu cycles on applications with a lot of communication with ble devices.The logging library this is based on, Timber, has this fixed.
The text was updated successfully, but these errors were encountered: