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

Skip to content
Commit 16c0ede0 authored by Kweku Adams's avatar Kweku Adams
Browse files

Use new sorting mechanism.

Switch the pending job sorting mechanism the new topological-sort-like
mechanism. The new system is generally more efficient and easier to
maintain than the previous implementation and allows for further
improvements such as batching in the queue (to reduce process restarts).

Runtime changes (A=# of apps, J=average # jobs per app):
                 Previous implementation      New implementation
Sorting:              A*J*log(A*J)                A*J*log(J)
Insertion:             log(A*J)                    log(A*J)+J
Remove(Object):          A*J                       log(A*J)
Iteration:               A*J                    A*J (amortized)
Contains:                A*J                       log(A*J)

Bug: 141645789
Bug: 204924801
Bug: 223437753
Test: atest frameworks/base/services/tests/servicestests/src/com/android/server/job
Test: atest frameworks/base/services/tests/mockingservicestests/src/com/android/server/job
Test: atest CtsJobSchedulerTestCases
Change-Id: I61cf8488d574e3c7be624b753a02e8c1f151f4fd
parent b0ea1d0b
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