Sam Delmerico | 24c5603 | 2022-03-28 19:53:03 +0000 | [diff] [blame] | 1 | // 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 | |
| 15 | package allowlists |
| 16 | |
Sam Delmerico | 24c5603 | 2022-03-28 19:53:03 +0000 | [diff] [blame] | 17 | const ( |
Jeongik Cha | b745e2e | 2023-04-11 14:28:43 +0900 | [diff] [blame] | 18 | // 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 Delmerico | 24c5603 | 2022-03-28 19:53:03 +0000 | [diff] [blame] | 25 | ) |
| 26 | |
| 27 | var ( |
Jeongik Cha | b745e2e | 2023-04-11 14:28:43 +0900 | [diff] [blame] | 28 | // 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 Cha | e114e60 | 2023-03-19 00:12:39 +0900 | [diff] [blame] | 35 | } |
Sam Delmerico | 24c5603 | 2022-03-28 19:53:03 +0000 | [diff] [blame] | 36 | ) |