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

Logging & performance #576

Closed
RohovDmytro opened this issue Sep 2, 2024 · 5 comments · Fixed by #577
Closed

Logging & performance #576

RohovDmytro opened this issue Sep 2, 2024 · 5 comments · Fixed by #577
Assignees
Labels
🤖 android Android specific

Comments

@RohovDmytro
Copy link

RohovDmytro commented Sep 2, 2024

By inspection logs I've observed a bit of logging in Android:

https://raw.githubusercontent.com/kirillzyusko/react-native-keyboard-controller/e852dd9af5fd1d30edaf0e684b6de8517a767697/android/src/main/java/com/reactnativekeyboardcontroller/listeners/KeyboardAnimationCallback.kt

Does it hurt the performance in production? Should we have an option to disable it during production during animation?

@kirillzyusko
Copy link
Owner

Thanks for bringing this @RohovDmytro

Yeah, I've been thinking on disabling these logs by default (I added them, but I didn't receive issues where such logging would be helpful).

It shouldn't have a big impact on performance (in my case it was nanoseconds per frame, so it doesn't really matter), but spamming logcat with those logs also not a good approach.

I think the ideal solution here would be to add a custom Logger-class that disabled by default, but if you need to capture logs (for debugging purposes) then you can enable it.

What is the industry standart for such things? 👀

@kirillzyusko kirillzyusko added the 🤖 android Android specific label Sep 2, 2024
@RohovDmytro
Copy link
Author

Aaaawesome! I will use this as an opportunity to send a huge respect for this library. It's awesome and it saved me from a nasty, nasty keyboard-management situation. Appreciate!

🤝

@RohovDmytro
Copy link
Author

Speaking about perf impact I did not made any measurements, my thinking was that during animations specifically logging might have some impact.

@kirillzyusko
Copy link
Owner

my thinking was that during animations specifically logging might have some impact.

That also was made my assumption when I added those logs, but when measured performance then I discovered that it doesn't really affect the performance.

However I don't really like to spam logcat console and reveal details about the app (like which library it does use underhood etc.) so I think the better solution here would be to disable logger in release builds by default (and people always can enable it if needed to capture some data).

@kirillzyusko
Copy link
Owner

I disabled logging in release in #577

So release version should be super fast (but debug version also should be pretty fast)!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🤖 android Android specific
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants