Summary: Finally, we add some preliminary documentation for cost analysis. Reviewed By: jvillard Differential Revision: D22043585 fbshipit-source-id: 1d3896a4emaster
parent
415824ac0e
commit
753b909bfa
@ -0,0 +1,7 @@
|
||||
Infer reports this issue when the execution time complexity of a
|
||||
program increases in degree: e.g. from constant to linear or from
|
||||
logarithmic to quadratic. This issue type is only reported in
|
||||
differential mode: i.e when we are comparing the analysis results of
|
||||
two runs of infer on a file.
|
||||
|
||||
|
@ -0,0 +1,11 @@
|
||||
Infer reports this issue when the execution time complexity of the procedure increases in degree **and** the procedure runs on the UI (main) thread.
|
||||
|
||||
Infer considers a method as running on the UI thread whenever:
|
||||
|
||||
- The method, one of its overrides, its class, or an ancestral class, is
|
||||
annotated with `@UiThread`.
|
||||
- The method, or one of its overrides is annotated with `@OnEvent`, `@OnClick`,
|
||||
etc.
|
||||
- The method or its callees call a `Litho.ThreadUtils` method such as
|
||||
`assertMainThread`.
|
||||
|
@ -0,0 +1,16 @@
|
||||
This issue type indicates that the program's execution doesn't reach
|
||||
the exit node. Hence, we cannot compute a static bound for the
|
||||
procedure.
|
||||
|
||||
|
||||
Examples:
|
||||
```java
|
||||
void exit_unreachable() {
|
||||
exit(0); // modeled as unreachable
|
||||
}
|
||||
|
||||
|
||||
void infeasible_path_unreachable() {
|
||||
Preconditions.checkState(false); // like assert false, state pruned to bottom
|
||||
}
|
||||
```
|
@ -0,0 +1,19 @@
|
||||
This warning indicates that Infer was not able to determine a static
|
||||
upper bound on the execution cost of the procedure. By default, this
|
||||
issue type is disabled.
|
||||
|
||||
|
||||
For instance, Inferbo's interval analysis is limited to affine
|
||||
expressions. Hence, we can't statically estimate an upper bound on the
|
||||
below example and obtain T(unknown) cost:
|
||||
```java
|
||||
// Expected: square root(x), got T
|
||||
void square_root_FP(int x) {
|
||||
int i = 0;
|
||||
while (i * i < x) {
|
||||
i++;
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
Consequently, we report an `INFINITE_EXECUTION_TIME`, corresponding to the biggest bound T.
|
Loading…
Reference in new issue