Uploaded image for project: 'Swift Driver'
  1. Swift Driver
  2. SWIFT-370

Audit the API to look for places we could be using autoclosures

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Backlog
    • Major - P3
    • Resolution: Unresolved
    • None
    • 2.0.0
    • None

    Description

      Autoclosures can be useful to avoid evaluating expensive expressions that may not end up getting used.
      For example, SWIFT-105 introduces a mobile logging API where the user provides a logging callback that takes in a few autoclosures that return strings. The autoclosures are only evaluated if the user actually uses those parameters. So if the user never wants to consume one of the fields or decides to discard a message based on its log level, we don't perform the expensive copy into a Swift string.

      There are likely other places in the API that could be improved by using autoclosures. we should investigate and create tickets for them.

      Attachments

        Activity

          People

            Unassigned Unassigned
            kaitlin.mahar@mongodb.com Kaitlin Mahar
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: