Skip to content

Hush some messages logged by default on startup #8414

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

Merged
merged 2 commits into from
Oct 11, 2023

Conversation

grendello
Copy link
Contributor

@grendello grendello commented Oct 11, 2023

We log a number of messages during startup, whether or not logging is
enabled. However, logcat messages take non-trivial (and not entirely
predictable) amount of time to process, so we should limit their number
by default in order to speed up startup.

Tests show the following improvements resulting from this change:

  • Displayed: 6.28% faster
  • Native-to-managed transition: 6.11% faster
  • Total native init time: 13.95% faster

We log a number of messages during startup, whether or not logging is
enabled.  However, logcat messages take non-trivial (and not entirely
predictable) amount of time to process, so we should limit their number
by default in order to speed up startup.

Tests show the following improvements resulting from this change:

  * Displayed: 1.49% faster
  * Native-to-managed transition: 7.47% faster
  * Total native init time: 5.94% faster
@grendello grendello requested a review from jonpryor as a code owner October 11, 2023 10:47
@grendello
Copy link
Contributor Author

I re-ran the performance tests with all of logcat logging disabled, including monodroid-timing messages (used the timing=fast-bare mode which doesn't log anything until asked to do so).
This way inherent logcat unpredictable behavior was completely removed and the results are more stable. Updated the OP accordingly.

@jonpryor
Copy link
Contributor

jonpryor commented Oct 11, 2023

We log a number of messages during startup, whether or not logging is
enabled.  However, logcat messages take non-trivial (and not entirely
predictable) amount of time to process, so we should limit their
number by default in order to speed up startup.

Tests show the following improvements[^0] resulting from this change:

  * Displayed: 6.28% faster
  * Native-to-managed transition: 6.11% faster
  * Total native init time: 13.95% faster

[^0]: Numbers from running [XAPerfTestRunner][0] with **all** of
      logcat logging disabled, including `monodroid-timing` messages.
      The `timing=fast-bare` mode is used, which doesn't log anything
      until asked to do so.

      This way logcat's inherently unpredictable behavior was
      completely removed and the results are more stable.

[0]: https://github.com/grendello/XAPerfTestRunner

@jonpryor jonpryor merged commit 6945132 into dotnet:main Oct 11, 2023
@grendello grendello deleted the hush-now branch October 11, 2023 20:36
grendello added a commit to grendello/xamarin-android that referenced this pull request Oct 12, 2023
* main:
  [Xamarin.Android.Build.Tasks] Fix up ForegroundService.ToString() (dotnet#8412)
  [monodroid] Hush some messages logged by default on startup (dotnet#8414)
@github-actions github-actions bot locked and limited conversation to collaborators Jan 22, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants