Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 08c4cb86 authored by Songchun Fan's avatar Songchun Fan
Browse files

[SettingsProvider] perf test for null settings

This is to track performance differences before and after the
cache optimization for null settings.

BUG: 228619157
Test: atest android.provider.SettingsProviderPerfTest
Change-Id: I04590d4d692d12970aa6d53789770fbe426f2c0e
parent 3ca4ad41
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -39,6 +39,7 @@ public final class SettingsProviderPerfTest {
    private static final String NAMESPACE = "test@namespace";
    private static final String SETTING_NAME1 = "test:setting1";
    private static final String SETTING_NAME2 = "test-setting2";
    private static final String UNSET_SETTING = "test_unset_setting";

    private final ContentResolver mContentResolver;

@@ -92,6 +93,14 @@ public final class SettingsProviderPerfTest {
        }
    }

    @Test
    public void testSettingsValueConsecutiveReadUnset() {
        final BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
        while (state.keepRunning()) {
            Settings.Secure.getString(mContentResolver, UNSET_SETTING);
        }
    }

    @Test
    public void testSettingsNamespaceConsecutiveRead() {
        final List<String> names = new ArrayList<>();