Runtime cost tracking functions for string extensions. These functions compute the actual cost of string operations after evaluation, using the real sizes of the inputs and outputs. trackStringCharAtCost tracks runtime cost for O(n) string operations.
(args []ref.Val, result ref.Val)
| 1030 | |
| 1031 | // trackStringCharAtCost tracks runtime cost for O(n) string operations. |
| 1032 | func trackStringCharAtCost(args []ref.Val, result ref.Val) *uint64 { |
| 1033 | size := float64(actualSize(args[0])) * stringCostFactor |
| 1034 | cost := safeAdd(callCost, uint64(math.Ceil(size)), 1) |
| 1035 | return &cost |
| 1036 | } |
| 1037 | |
| 1038 | // trackStringTransformCost tracks runtime cost for O(n) string operations. |
| 1039 | func trackStringTransformCost(args []ref.Val, result ref.Val) *uint64 { |
nothing calls this directly
no test coverage detected