iOS 15.2 is taking long to calculate predicates

160 views Asked by At

I have an array with around 200K elements and I am using this predicate to filter some elements.

NSArray * filteredArray = [mainArray filteredArrayUsingPredicate: 
  [NSPredicate predicateWithFormat: @"(value1 == %@) && 
  (value2 == %@) && (value3 >= %d) && (value4 != %@)",
  value1, value2, value3, value4]
];

When I am running this app in iPad older iOS versions this code takes 0.22 seconds for execution. (I have tested in iOS 14.7, 12.4, 13.2 etc..). But when I am running the it in iOS 15.1 or 15.2 the same code takes 0.63 seconds for execution.

Does anyone know why it is taking long time in new iOS version? Any help would be appreciated.

0

There are 0 answers