Optimize pending job queue iteration.
Batch the jobs pulled during iteration so that we pull several of an app's jobs from the queue sequentially (resulting in some out of order pulls) instead of pulling purely based on the sort order. Batching it this way will mean we try to run several jobs of the same app at the same, resulting in fewer process restarts, and can allow the iteration runtime to amortize to O(A*J) instead of O(A*J*log(A)) for A <= 33, where A = # apps and J = average # jobs per app. Bug: 204924801 Test: atest FrameworksServicesTests:PendingJobQueueTest Change-Id: I4d3dc17afb4d4ab0fb573d75a319bdb20a68c634
Loading
Please register or sign in to comment