trackStringTransformCost tracks runtime cost for O(n) string operations.
(args []ref.Val, result ref.Val)
| 1037 | |
| 1038 | // trackStringTransformCost tracks runtime cost for O(n) string operations. |
| 1039 | func trackStringTransformCost(args []ref.Val, result ref.Val) *uint64 { |
| 1040 | transformCost := math.Ceil(float64(actualSize(args[0])) * stringCostFactor) |
| 1041 | resultSize := actualSize(result) |
| 1042 | cost := safeAdd(callCost, uint64(transformCost), resultSize) |
| 1043 | return &cost |
| 1044 | } |
| 1045 | |
| 1046 | // trackStringSearchCost tracks runtime cost for O(n*m) string search operations. |
| 1047 | func trackStringSearchCost(args []ref.Val, _ ref.Val) *uint64 { |
nothing calls this directly
no test coverage detected