Reviewed By: ngorogiannis Differential Revision: D14682333 fbshipit-source-id: 4e1050c27master
parent
ba42e3fa46
commit
b500b5ffa0
@ -1 +1 @@
|
||||
{"top":{"current":2,"previous":1},"zero":{"current":0,"previous":0},"degrees":[{"degree":0,"current":3,"previous":2},{"degree":100,"current":1,"previous":2},{"degree":101,"current":2,"previous":0},{"degree":200,"current":0,"previous":2}]}
|
||||
{"top":{"current":4,"previous":2},"zero":{"current":0,"previous":0},"degrees":[{"degree":0,"current":6,"previous":4},{"degree":100,"current":2,"previous":4},{"degree":101,"current":4,"previous":0},{"degree":200,"current":0,"previous":4}]}
|
@ -0,0 +1 @@
|
||||
[{"function_name":"DiffExampleColdStart::f1","count_trace_id":2,"sum_inclusive_cpu_time":44,"avg_inclusive_cpu_time_ms":22,"sum_exclusive_cpu_time":0,"avg_exclusive_cpu_time_ms":0,"p90_inclusive_cpu_time_ms":22,"p90_exclusive_cpu_time_ms":0,"p50_inclusive_cpu_time_ms":22,"p50_exclusive_cpu_time_ms":0,"p25_inclusive_cpu_time_ms":22,"p25_exclusive_cpu_time_ms":0},{"function_name":"DiffExampleColdStart::f2","count_trace_id":1,"sum_inclusive_cpu_time":11,"avg_inclusive_cpu_time_ms":11,"sum_exclusive_cpu_time":0,"avg_exclusive_cpu_time_ms":0,"p90_inclusive_cpu_time_ms":11,"p90_exclusive_cpu_time_ms":0,"p50_inclusive_cpu_time_ms":11,"p50_exclusive_cpu_time_ms":0,"p25_inclusive_cpu_time_ms":11,"p25_exclusive_cpu_time_ms":0},{"function_name":"DiffExampleColdStart::f3","count_trace_id":2,"sum_inclusive_cpu_time":44,"avg_inclusive_cpu_time_ms":22,"sum_exclusive_cpu_time":0,"avg_exclusive_cpu_time_ms":0,"p90_inclusive_cpu_time_ms":22,"p90_exclusive_cpu_time_ms":0,"p50_inclusive_cpu_time_ms":22,"p50_exclusive_cpu_time_ms":0,"p25_inclusive_cpu_time_ms":22,"p25_exclusive_cpu_time_ms":0},{"function_name":"DiffExampleColdStart::f4","count_trace_id":2,"sum_inclusive_cpu_time":44,"avg_inclusive_cpu_time_ms":22,"sum_exclusive_cpu_time":0,"avg_exclusive_cpu_time_ms":0,"p90_inclusive_cpu_time_ms":22,"p90_exclusive_cpu_time_ms":0,"p50_inclusive_cpu_time_ms":22,"p50_exclusive_cpu_time_ms":0,"p25_inclusive_cpu_time_ms":22,"p25_exclusive_cpu_time_ms":0},{"function_name":"DiffExampleColdStart::f55","count_trace_id":2,"sum_inclusive_cpu_time":44,"avg_inclusive_cpu_time_ms":22,"sum_exclusive_cpu_time":0,"avg_exclusive_cpu_time_ms":0,"p90_inclusive_cpu_time_ms":22,"p90_exclusive_cpu_time_ms":0,"p50_inclusive_cpu_time_ms":22,"p50_exclusive_cpu_time_ms":0,"p25_inclusive_cpu_time_ms":22,"p25_exclusive_cpu_time_ms":0},{"function_name":"DiffExampleColdStart::f6","count_trace_id":2,"sum_inclusive_cpu_time":44,"avg_inclusive_cpu_time_ms":22,"sum_exclusive_cpu_time":0,"avg_exclusive_cpu_time_ms":0,"p90_inclusive_cpu_time_ms":22,"p90_exclusive_cpu_time_ms":0,"p50_inclusive_cpu_time_ms":22,"p50_exclusive_cpu_time_ms":0,"p25_inclusive_cpu_time_ms":22,"p25_exclusive_cpu_time_ms":0}]
|
@ -1 +1,2 @@
|
||||
INFINITE_EXECUTION_TIME_CALL, no_bucket, src/DiffExample.java, DiffExample.f7(int):void, 0, [Call to void DiffExample.f1(int),Unbounded loop,Loop at line 26]
|
||||
INFINITE_EXECUTION_TIME_CALL, no_bucket, src/DiffExampleColdStart.java, DiffExampleColdStart.f7(int):void, 0, [Call to void DiffExampleColdStart.f1(int),Unbounded loop,Loop at line 26]
|
||||
|
@ -0,0 +1,64 @@
|
||||
/*
|
||||
* Copyright (c) 2015-present, Facebook, Inc.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*/
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
// This class has the following costs:
|
||||
// 1 bottom (zero), 2 constant, 1 linear, 1 top
|
||||
// constructor: constant
|
||||
// f1: top
|
||||
// f2: bottom (zero)
|
||||
// f3: constant
|
||||
// f4: linear
|
||||
// f5: n log n
|
||||
// f6: n log n
|
||||
// f7: top by call to f1
|
||||
|
||||
public class DiffExampleColdStart {
|
||||
|
||||
// cost: top
|
||||
private static void f1(int k) {
|
||||
int i = 0;
|
||||
while (i >=0) {
|
||||
i++;
|
||||
}
|
||||
}
|
||||
|
||||
// cost: bottom (0)
|
||||
private static void f2(int k) {}
|
||||
|
||||
// cost: constant (5)
|
||||
private static int f3() {
|
||||
int i, j;
|
||||
i = 17;
|
||||
j = 31;
|
||||
|
||||
return i + j + 3 + 7;
|
||||
}
|
||||
|
||||
// cost: linear
|
||||
private static int f4(int k) {
|
||||
for (int i = 0; i < k; i++) {
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
// cost: n log n
|
||||
private void f5(ArrayList<Integer> list) {
|
||||
java.util.Collections.sort(list);
|
||||
}
|
||||
|
||||
// cost: n log n
|
||||
private void f6(ArrayList<Integer> list) {
|
||||
f5(list);
|
||||
}
|
||||
|
||||
// cost: top by call to f1
|
||||
private static void f7(int k) {
|
||||
f1(k);
|
||||
}
|
||||
}
|
@ -0,0 +1,56 @@
|
||||
/*
|
||||
* Copyright (c) 2015-present, Facebook, Inc.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*/
|
||||
|
||||
// This class has the following costs:
|
||||
// 2 constant, 1 linear, 1 quadratic
|
||||
// constructor: constant
|
||||
// f1: linear
|
||||
// f2: quadratic
|
||||
// f4: constant
|
||||
// f5: linear
|
||||
// f6: quadratic
|
||||
// f7: top
|
||||
|
||||
public class DiffExampleColdStart {
|
||||
// cost: linear
|
||||
private static int f1(int k) {
|
||||
for (int i = 0; i < k; i++) {
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
// cost: quadratic
|
||||
private static void f2(int k) {
|
||||
for (int i = 0; i < k; i++) {
|
||||
f1(k);
|
||||
}
|
||||
}
|
||||
|
||||
// cost: constant
|
||||
private static int f4(int k) {
|
||||
int i = 1;
|
||||
return i + k;
|
||||
}
|
||||
|
||||
// cost: linear
|
||||
private static void f5(int n) {
|
||||
f1(n);
|
||||
}
|
||||
|
||||
// cost: quadratic
|
||||
private static void f6(int n) {
|
||||
f2(n);
|
||||
}
|
||||
|
||||
// cost: top
|
||||
private static void f7(int k) {
|
||||
int i = 0;
|
||||
while (i >=0) {
|
||||
i++;
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in new issue