@@ -1016,7 +1016,14 @@ type profile = {
1016
1016
<python repr="dict">
1017
1017
<ts repr="map">;
1018
1018
1019
+ (* EXPERIMENTAL *)
1019
1020
?parsing_time : parsing_time option;
1021
+ (* EXPERIMENTAL *)
1022
+ ?scanning_time : scanning_time option;
1023
+ (* EXPERIMENTAL *)
1024
+ ?matching_time : matching_time option;
1025
+ (* EXPERIMENTAL *)
1026
+ ?tainting_time : tainting_time option;
1020
1027
1021
1028
targets: target_times list;
1022
1029
total_bytes: int;
@@ -1025,22 +1032,78 @@ type profile = {
1025
1032
?max_memory_bytes : int option;
1026
1033
}
1027
1034
1035
+ (* EXPERIMENTAL *)
1028
1036
type file_time <ocaml attr="deriving show"> = {
1029
1037
fpath: fpath;
1030
1038
ftime: float;
1031
1039
}
1032
1040
1041
+ (* EXPERIMENTAL *)
1042
+ type file_rule_time <ocaml attr="deriving show"> = {
1043
+ fpath: fpath;
1044
+ rule_id: rule_id;
1045
+ time: float;
1046
+ }
1047
+
1048
+ (* EXPERIMENTAL *)
1049
+ type def_rule_time <ocaml attr="deriving show"> = {
1050
+ fpath: fpath;
1051
+ fline : int;
1052
+ rule_id: rule_id;
1053
+ time: float;
1054
+ }
1055
+
1056
+ (* EXPERIMENTAL *)
1033
1057
type summary_stats = {
1034
1058
mean: float;
1035
1059
std_dev: float;
1036
1060
}
1037
1061
1062
+ (* These ratios are numbers in [0, 1], and we would hope that both 'time_ratio'
1063
+ and 'count_ratio' are very close to 0. In bad cases, we may see the 'count_ratio'
1064
+ being close to 0 while the 'time_ratio' is above 0.5, meaning that a small number
1065
+ of very slow files/etc represent a large amount of the total processing time. *)
1066
+ (* EXPERIMENTAL *)
1067
+ type very_slow_stats = {
1068
+ time_ratio: float;
1069
+ (* Ratio "sum of very slow time" / "total time" *)
1070
+ count_ratio: float;
1071
+ (* Ratio "very slow count" / "total count" *)
1072
+ }
1073
+
1074
+ (* EXPERIMENTAL *)
1038
1075
type parsing_time = {
1039
1076
total_time: float;
1040
1077
per_file_time: summary_stats;
1078
+ ?very_slow_stats: very_slow_stats option;
1041
1079
very_slow_files: file_time list; (* ascending order *)
1042
1080
}
1043
1081
1082
+ (* Scanning time (includes matching and tainting) *)
1083
+ (* EXPERIMENTAL *)
1084
+ type scanning_time = {
1085
+ total_time : float;
1086
+ per_file_time: summary_stats;
1087
+ very_slow_stats: very_slow_stats;
1088
+ very_slow_files: file_time list; (* ascending order *)
1089
+ }
1090
+
1091
+ (* EXPERIMENTAL *)
1092
+ type matching_time = {
1093
+ total_time : float;
1094
+ per_file_and_rule_time : summary_stats;
1095
+ very_slow_stats: very_slow_stats;
1096
+ very_slow_rules_on_files: file_rule_time list; (* ascending order *)
1097
+ }
1098
+
1099
+ (* EXPERIMENTAL *)
1100
+ type tainting_time = {
1101
+ total_time : float;
1102
+ per_def_and_rule_time : summary_stats;
1103
+ very_slow_stats: very_slow_stats;
1104
+ very_slow_rules_on_defs: def_rule_time list; (* ascending order *)
1105
+ }
1106
+
1044
1107
type target_times = {
1045
1108
path: fpath;
1046
1109
num_bytes: int;
0 commit comments