The MkAnnotationView constructor takes more time in iOS17

As an iOS native MapKit engineer, the MkAnnotationView constructor "initWithAnnotation:reuseIdentifier:" seems to take more time in iOS 17.

Just use the code snippet below to measure the time, it constructs 50,000 MKAnnotationView objects.

long st = [[NSDate date] timeIntervalSince1970] * 1000;
NSLog(@"create annotation view start time = %ld", st);
MKAnnotationView *myAV = nil;
MKPointAnnotation *anno = [[MKPointAnnotation alloc] init];
anno.coordinate = CLLocationCoordinate2DMake(64, 121);
for (int i = 0; i < 50000; ++i) {
    myAV = [[MKAnnotationView alloc] initWithAnnotation:anno reuseIdentifier:[@"hehe" stringByAppendingString:[NSString stringWithFormat:@"%d", i]]];
}
long ed = [[NSDate date] timeIntervalSince1970] * 1000;
NSLog(@"create annotation view end time = %ld, interval = %ld", ed, ed - st);`

In iOS17, it takes around 2.6s.

In iOS16, it takes around 0.9s.

This performance degradation between different iOS version(iOS SDK 16 vs. iOS SDK 17) affects our app which uses the native MKMapView.

Could someone take a look at this issue or offer any workaround?

The MkAnnotationView constructor takes more time in iOS17
 
 
Q