[cost] Add FP test for NSDictionary initialization

Reviewed By: roro47

Differential Revision: D23396528

fbshipit-source-id: adc1ae05f
master
Ezgi Çiçek 4 years ago committed by Facebook GitHub Bot
parent 7cb8145ef6
commit 06489dced0

@ -99,3 +99,11 @@ void nsdictionary_enumerator_linear(NSDictionary* dict) {
while ((key = [enumerator nextObject])) {
}
}
void nsdictionary_enumerate_call_constant_FP() {
NSDictionary* dict =
@{@"helloString" : @"Hello, World!",
@"magicNumber" : @42};
nsdictionary_all_values_linear(dict);
}

@ -27,6 +27,7 @@ codetoanalyze/objc/performance/NSDictionary.m, nsdictionary_all_keys_linear1, 3
codetoanalyze/objc/performance/NSDictionary.m, nsdictionary_all_keys_linear2, 6 + 3 ⋅ dict->elements.length.ub + 3 ⋅ (dict->elements.length.ub + 1), OnUIThread:false, [{dict->elements.length.ub + 1},Loop,{dict->elements.length.ub},Loop]
codetoanalyze/objc/performance/NSDictionary.m, nsdictionary_all_values_linear, 3 + 3 ⋅ dict->elements.length.ub + 4 ⋅ (dict->elements.length.ub + 1), OnUIThread:false, [{dict->elements.length.ub + 1},Loop,{dict->elements.length.ub},Loop]
codetoanalyze/objc/performance/NSDictionary.m, nsdictionary_dictionary_with_objects_linear, 14 + 15 ⋅ n_entries + 3 ⋅ n_entries + 2 ⋅ (1+max(0, n_entries)) + 4 ⋅ (1+max(0, n_entries)), OnUIThread:false, [{1+max(0, n_entries)},Loop,{1+max(0, n_entries)},Loop,{n_entries},Loop,{n_entries},Loop]
codetoanalyze/objc/performance/NSDictionary.m, nsdictionary_enumerate_call_constant_FP, , OnUIThread:false, [Unbounded value dict->elements.length.ub,Call to nsdictionary_all_values_linear,Loop]
codetoanalyze/objc/performance/NSDictionary.m, nsdictionary_enumerate_constant, 52, OnUIThread:false, []
codetoanalyze/objc/performance/NSDictionary.m, nsdictionary_enumerator_linear, 5 + dict->elements.length.ub + 4 ⋅ (dict->elements.length.ub + 1), OnUIThread:false, [{dict->elements.length.ub + 1},Loop,{dict->elements.length.ub},Loop]
codetoanalyze/objc/performance/NSDictionary.m, nsdictionary_fast_enumerate_linear, 5 + dict->elements.length.ub + 4 ⋅ (dict->elements.length.ub + 1), OnUIThread:false, [{dict->elements.length.ub + 1},Loop,{dict->elements.length.ub},Loop]

@ -1,5 +1,7 @@
codetoanalyze/objc/performance/NSArray.m, nsarray_empty_array_constant, 3, CONDITION_ALWAYS_FALSE, no_bucket, WARNING, [Here]
codetoanalyze/objc/performance/NSArray.m, nsarray_init_constant, 3, CONDITION_ALWAYS_FALSE, no_bucket, WARNING, [Here]
codetoanalyze/objc/performance/NSDictionary.m, nsdictionary_enumerate_call_constant_FP, 0, INFINITE_EXECUTION_TIME, no_bucket, ERROR, [Unbounded value dict->elements.length.ub,Call to nsdictionary_all_values_linear,Loop]
codetoanalyze/objc/performance/NSDictionary.m, nsdictionary_enumerate_call_constant_FP, 5, INTEGER_OVERFLOW_U5, no_bucket, ERROR, [Unknown value from: NSDictionary.dictionaryWithObjects:forKeys:count:,Call,<LHS trace>,Parameter `dict->elements[*]`,Binary operation: ([0, +oo] + 1):signed32 by call to `nsdictionary_all_values_linear` ]
codetoanalyze/objc/performance/NSDictionary.m, nsdictionary_init_with_dictionary_linear_FP, 0, INFINITE_EXECUTION_TIME, no_bucket, ERROR, [Unbounded loop,Loop]
codetoanalyze/objc/performance/NSDictionary.m, nsdictionary_init_with_dictionary_linear_FP, 2, INTEGER_OVERFLOW_U5, no_bucket, ERROR, [<LHS trace>,Unknown value from: NSDictionary.initWithDictionary:,Binary operation: ([0, +oo] + 1):signed32]
codetoanalyze/objc/performance/NSMutableArray.m, nsarray_new_constant, 2, CONDITION_ALWAYS_FALSE, no_bucket, WARNING, [Here]

Loading…
Cancel
Save