[Cost] Add cost model of binary search

Reviewed By: roro47

Differential Revision: D23166426

fbshipit-source-id: 8a8ac9d69
master
Sungkeun Cho 4 years ago committed by Facebook GitHub Bot
parent 3e7bf4343b
commit 88d5f4b9ad

@ -171,6 +171,8 @@ module Java = struct
let implements_psi_element = implements "com.intellij.psi.PsiElement"
let implements_sparse_float_array = implements "com.facebook.litho.internal.SparseFloatArray"
let implements_view_group = implements "android.view.ViewGroup"
let implements_view_parent = implements "android.view.ViewParent"

@ -104,6 +104,9 @@ module Java : sig
val implements_psi_element : Tenv.t -> string -> bool
(** Check whether class implements a class of [com.intellij.psi.PsiElement] *)
val implements_sparse_float_array : Tenv.t -> string -> bool
(** Check whether class implements a class of [com.facebook.litho.internal.SparseFloatArray] *)
val implements_view_group : Tenv.t -> string -> bool
(** Check whether class implements a class of [android.view.ViewGroup] *)

@ -302,7 +302,10 @@ module Call = struct
&:: "construct" <>$ capt_exp_of_prim_typ int_typ $+...$--> ImmutableSet.construct
; +PatternMatch.Java.implements_google "common.collect.ImmutableSet"
&:: "construct" <>$ any_arg $+ capt_exp_of_prim_typ int_typ
$+...$--> ImmutableSet.construct ]
$+...$--> ImmutableSet.construct
; +PatternMatch.Java.implements_sparse_float_array
&:: "binarySearch" <>$ any_arg $+ capt_exp_of_prim_typ int_typ
$+...$--> log ~of_function:"binarySearch" ]
in
merge_dispatchers dispatcher FbCostModels.Call.dispatch
end

Loading…
Cancel
Save