blob: a52bff318ef46126a115657449529e3915960d94 [file] [log] [blame]
Sam Delmerico24c56032022-03-28 19:53:03 +00001// Copyright 2022 Google Inc. All rights reserved.
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7// http://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14
15package allowlists
16
Sam Delmerico24c56032022-03-28 19:53:03 +000017const (
Jeongik Chab745e2e2023-04-11 14:28:43 +090018 // Modules with build time of more than half a minute should have high priority.
19 DEFAULT_PRIORITIZED_WEIGHT = 1000
20 // Modules with build time of more than a few minute should have higher priority.
21 HIGH_PRIORITIZED_WEIGHT = 10 * DEFAULT_PRIORITIZED_WEIGHT
22 // Modules with inputs greater than the threshold should have high priority.
23 // Adjust this threshold if there are lots of wrong predictions.
24 INPUT_SIZE_THRESHOLD = 50
Sam Delmerico24c56032022-03-28 19:53:03 +000025)
26
27var (
Jeongik Chab745e2e2023-04-11 14:28:43 +090028 // The list of module types which are expected to spend lots of build time.
29 // With `--ninja_weight_source=soong`, ninja builds these module types and deps first.
30 HugeModuleTypePrefixMap = map[string]int{
31 "rust_": HIGH_PRIORITIZED_WEIGHT,
32 "droidstubs": DEFAULT_PRIORITIZED_WEIGHT,
33 "art_": DEFAULT_PRIORITIZED_WEIGHT,
34 "ndk_library": DEFAULT_PRIORITIZED_WEIGHT,
Jeongik Chae114e602023-03-19 00:12:39 +090035 }
Sam Delmerico24c56032022-03-28 19:53:03 +000036)