Skip to content
Commit 5fae035a authored by Jeff Sharkey's avatar Jeff Sharkey
Browse files

Additional notification performance improvements.

The initial design that accepted a Collection<Uri> for notifyChange()
simply looped over the collection once inside the system_server, which
was offered a great initial performance improvement.

However, there were still inefficiencies in how we validated
ContentProvider access, dispatched sync adapter changes, and
invalidated internal caches.  This change optimizes those operations
by performing them only once per (authority, userId) tuple, and by
caching the getProviderPackageName() answer.  Local tests show that
this change roughly doubles the speed.

Before this CL:
    notifyInsert count=50 duration=5958061219ns average=119ms
    notifyUpdate count=50 duration=5696640780ns average=113ms
    notifyDelete count=50 duration=4344581840ns average=86ms

After this CL:
    notifyInsert count=50 duration=3287114546ns average=65ms
    notifyUpdate count=50 duration=3103146196ns average=62ms
    notifyDelete count=50 duration=2033265671ns average=40ms

Bug: 144464323
Test: atest CtsDatabaseTestCases
Test: atest CtsContentTestCases:android.content.cts.ContentResolverTest
Test: atest FrameworksServicesTests:com.android.server.content.ObserverNodeTest
Test: atest com.android.providers.media.client.PerformanceTest#testBulk
Change-Id: Idfda019fcc123ee7118b1856a8ff7332a17b5ef9
parent 2328849c
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment