Making the name and error message for performance variation in cold start stronger

Reviewed By: mbouaziz

Differential Revision: D15240678

fbshipit-source-id: 1c93d2e43
master
Dino Distefano 6 years ago committed by Facebook Github Bot
parent 5a18ad5c69
commit 144847219e

@ -152,7 +152,7 @@ let issue_of_cost cost_info ~delta ~prev_cost ~curr_cost =
if CostDomain.BasicCost.is_top curr_cost then IssueType.infinite_execution_time_call
else if CostDomain.BasicCost.is_zero curr_cost then IssueType.zero_execution_time_call
else if ExternalPerfData.in_profiler_data_map procname then
IssueType.performance_variation_critical_cold_start
IssueType.time_complexity_increase_cold_start
else IssueType.performance_variation
in
let curr_degree_with_term = CostDomain.BasicCost.get_degree_with_term curr_cost in
@ -174,14 +174,20 @@ let issue_of_cost cost_info ~delta ~prev_cost ~curr_cost =
if Config.developer_mode then curr_cost_msg fmt ()
else Format.fprintf fmt "Please make sure this is an expected change."
in
let cold_start_msg =
if ExternalPerfData.in_profiler_data_map procname then
"This function is called during cold start. It is very important to avoid potential \
regressions in this phase."
else ""
in
let prev_degree_with_term = CostDomain.BasicCost.get_degree_with_term prev_cost in
Format.asprintf "Complexity of this function has %a from %a to %a. %a"
Format.asprintf "Complexity of this function has %a from %a to %a. %s %a"
(MarkupFormatter.wrap_bold pp_delta)
delta
(MarkupFormatter.wrap_monospaced (CostDomain.BasicCost.pp_degree ~only_bigO:true))
prev_degree_with_term
(MarkupFormatter.wrap_monospaced (CostDomain.BasicCost.pp_degree ~only_bigO:true))
curr_degree_with_term pp_extra_msg ()
curr_degree_with_term cold_start_msg pp_extra_msg ()
in
let line = cost_info.Jsonbug_t.loc.lnum in
let column = cost_info.Jsonbug_t.loc.cnum in

@ -347,8 +347,6 @@ let parameter_not_null_checked = from_string "PARAMETER_NOT_NULL_CHECKED"
let performance_variation = from_string "PERFORMANCE_VARIATION"
let performance_variation_critical_cold_start = from_string "PERFORMANCE_VARIATION_COLD_START"
let pointer_size_mismatch = from_string "POINTER_SIZE_MISMATCH"
let precondition_not_found = from_string "PRECONDITION_NOT_FOUND"
@ -403,6 +401,8 @@ let tainted_memory_allocation = from_string "TAINTED_MEMORY_ALLOCATION"
let thread_safety_violation = from_string "THREAD_SAFETY_VIOLATION"
let time_complexity_increase_cold_start = from_string "TIME_COMPLEXITY_INCREASE_COLD_START"
let unary_minus_applied_to_unsigned_expression =
from_string ~enabled:false "UNARY_MINUS_APPLIED_TO_UNSIGNED_EXPRESSION"

@ -245,8 +245,6 @@ val parameter_not_null_checked : t
val performance_variation : t
val performance_variation_critical_cold_start : t
val pointer_size_mismatch : t
val precondition_not_found : t
@ -299,6 +297,8 @@ val tainted_memory_allocation : t
val thread_safety_violation : t
val time_complexity_increase_cold_start : t
val unary_minus_applied_to_unsigned_expression : t
val uninitialized_value : t

@ -1,2 +1,2 @@
PERFORMANCE_VARIATION, no_bucket, src/DiffExample.java, DiffExample.f6(java.util.ArrayList):void, 0, [Updated Cost is 5 + list.length × log(list.length) (degree is 1 + 1⋅log),{list.length},call to void DiffExample.f5(ArrayList),Modeled call to List.length,{list.length},call to void DiffExample.f5(ArrayList),Modeled call to List.length]
PERFORMANCE_VARIATION_COLD_START, no_bucket, src/DiffExampleColdStart.java, DiffExampleColdStart.f6(java.util.ArrayList):void, 0, [Updated Cost is 5 + list.length × log(list.length) (degree is 1 + 1⋅log),{list.length},call to void DiffExampleColdStart.f5(ArrayList),Modeled call to List.length,{list.length},call to void DiffExampleColdStart.f5(ArrayList),Modeled call to List.length]
TIME_COMPLEXITY_INCREASE_COLD_START, no_bucket, src/DiffExampleColdStart.java, DiffExampleColdStart.f6(java.util.ArrayList):void, 0, [Updated Cost is 5 + list.length × log(list.length) (degree is 1 + 1⋅log),{list.length},call to void DiffExampleColdStart.f5(ArrayList),Modeled call to List.length,{list.length},call to void DiffExampleColdStart.f5(ArrayList),Modeled call to List.length]

@ -2,5 +2,5 @@ INFINITE_EXECUTION_TIME_CALL, no_bucket, src/DiffExample.java, DiffExample.f1(in
PERFORMANCE_VARIATION, no_bucket, src/DiffExample.java, DiffExample.f4(int):int, 0, [Updated Cost is 6 + 5 ⋅ k (degree is 1),{k},Loop at line 45]
PERFORMANCE_VARIATION, no_bucket, src/DiffExample.java, DiffExample.f5(java.util.ArrayList):void, 0, [Updated Cost is 2 + list.length × log(list.length) (degree is 1 + 1⋅log),{list.length},Modeled call to List.length,{list.length},Modeled call to List.length]
INFINITE_EXECUTION_TIME_CALL, no_bucket, src/DiffExampleColdStart.java, DiffExampleColdStart.f1(int):void, 0, [Unbounded loop,Loop at line 26]
PERFORMANCE_VARIATION_COLD_START, no_bucket, src/DiffExampleColdStart.java, DiffExampleColdStart.f4(int):int, 0, [Updated Cost is 6 + 5 ⋅ k (degree is 1),{k},Loop at line 45]
TIME_COMPLEXITY_INCREASE_COLD_START, no_bucket, src/DiffExampleColdStart.java, DiffExampleColdStart.f4(int):int, 0, [Updated Cost is 6 + 5 ⋅ k (degree is 1),{k},Loop at line 45]
PERFORMANCE_VARIATION, no_bucket, src/DiffExampleColdStart.java, DiffExampleColdStart.f5(java.util.ArrayList):void, 0, [Updated Cost is 2 + list.length × log(list.length) (degree is 1 + 1⋅log),{list.length},Modeled call to List.length,{list.length},Modeled call to List.length]

Loading…
Cancel
Save