title: EKEventStore.fetchReminders is very slow using it the first time
body: <p>On macOS I'm loading reminders using EventKit. Everything works, but when loading the reminders for the first time during runtime, it takes way longer than after that. This means the user has to wait after starting the app to see any reminders, which is not so nice. The native Reminders app works faster.</p>
  
  <p>Here is some code:</p>
  
  <pre><code>import Cocoa
  import EventKit
  
  @NSApplicationMain
  class AppDelegate: NSObject, NSApplicationDelegate {
  
      @IBOutlet weak var window: NSWindow!
      let semaphore = DispatchSemaphore(value: 0)
  
      func applicationDidFinishLaunching(_ aNotification: Notification) {
          testReminders()
      }
  
      func testReminders() {
          let eventStore = EKEventStore()
          let incompletePredicate = eventStore.predicateForIncompleteReminders(withDueDateStarting: Date(), ending: Date(), calendars: nil)
  
          // Get the access permission first
          eventStore.requestAccess(to: .reminder, completion: { (granted, error) in
              // Now test
              self.semaphore.signal()
              for _ in 0..&lt;10 {
                  self.startMeasuring(eventStore, predicate: incompletePredicate)
              }
          })
      }
  
      func startMeasuring(_ eventStore: EKEventStore, predicate: NSPredicate) {
          semaphore.wait()
          let start = DispatchTime.now()
  
          // Get the reminders
          eventStore.fetchReminders(matching: predicate, completion: { (incompletedReminders: [EKReminder]?) -&gt; Void in
              let end = DispatchTime.now()
  
              // Print out the elapsed time
              let nanoTime = end.uptimeNanoseconds - start.uptimeNanoseconds
              let timeInterval = Double(nanoTime) / 1_000_000_000
              print("elapsed: \(timeInterval)")
  
              self.semaphore.signal()
          })
      }
  
      func applicationWillTerminate(_ aNotification: Notification) {
          // Insert code here to tear down your application
      }
  }
  </code></pre>
  
  <p>If you are running above code, make sure you checked "Calendar" in the "App Sandbox" Capabilities.</p>
  
  <p>Here is the output in seconds:</p>
  
  <blockquote>
    <p>elapsed: 9.322825215<br>
    elapsed: 0.045737709<br>
    elapsed: 0.036359244<br>
    elapsed: 0.03218976<br>
    elapsed: 0.044998467<br>
    elapsed: 0.034777283<br>
    elapsed: 0.032737581<br>
    elapsed: 0.04387221<br>
    elapsed: 0.03941968<br>
    elapsed: 0.044008471  </p>
  </blockquote>
  
  <p>9 seconds is way too long. How can I fix this?</p>