Commit 01572ad
perf(android): mini optimization: Guard manifest metadata debug logs behind isEnabled (#5790)
* perf(android): Guard manifest metadata debug logs behind isEnabled (JAVA-614)
The read helpers in ManifestMetadataReader built the debug message
(key + " read: " + value) unconditionally at the call site, and
DiagnosticLogger only filtered on options.isDebug() afterward. With
debug=false (the default) that discarded ~100 StringBuilder/String
allocations per init.
Guard the six read helpers with logger.isEnabled(DEBUG) so the message
is only constructed when debug logging is actually on. Behavior is
unchanged; this is a pure allocation/GC-pressure reduction on the init
path.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
* changelog
---------
Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>1 parent bbcf99a commit 01572ad
2 files changed
Lines changed: 22 additions & 6 deletions
File tree
- sentry-android-core/src/main/java/io/sentry/android/core
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
5 | 9 | | |
6 | 10 | | |
7 | 11 | | |
| |||
Lines changed: 18 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
779 | 779 | | |
780 | 780 | | |
781 | 781 | | |
782 | | - | |
| 782 | + | |
| 783 | + | |
| 784 | + | |
783 | 785 | | |
784 | 786 | | |
785 | 787 | | |
| |||
789 | 791 | | |
790 | 792 | | |
791 | 793 | | |
792 | | - | |
| 794 | + | |
| 795 | + | |
| 796 | + | |
793 | 797 | | |
794 | 798 | | |
795 | 799 | | |
| |||
799 | 803 | | |
800 | 804 | | |
801 | 805 | | |
802 | | - | |
| 806 | + | |
| 807 | + | |
| 808 | + | |
803 | 809 | | |
804 | 810 | | |
805 | 811 | | |
806 | 812 | | |
807 | 813 | | |
808 | 814 | | |
809 | | - | |
| 815 | + | |
| 816 | + | |
| 817 | + | |
810 | 818 | | |
811 | 819 | | |
812 | 820 | | |
| |||
821 | 829 | | |
822 | 830 | | |
823 | 831 | | |
824 | | - | |
| 832 | + | |
| 833 | + | |
| 834 | + | |
825 | 835 | | |
826 | 836 | | |
827 | 837 | | |
| |||
832 | 842 | | |
833 | 843 | | |
834 | 844 | | |
835 | | - | |
| 845 | + | |
| 846 | + | |
| 847 | + | |
836 | 848 | | |
837 | 849 | | |
838 | 850 | | |
| |||
0 commit comments