Uploaded image for project: 'Swift'
  1. Swift
  2. SR-12972

SourceLocationConverter initializer that accepts a SourceFileSyntax is slower than the String version

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Open
    • Priority: Medium
    • Resolution: Unresolved
    • Component/s: SwiftSyntax
    • Labels:
      None

      Description

      SourceLocationConverter has 2 initializers, one uses a String and the other uses a SourceFileSyntax. Based on my testing, the String based initializer is noticeably faster than using a SourceFileSyntax.

      For a test case, I selected a relatively large file from swift-syntax (~ 10k LOC). The initializer that accepts a string takes ~ 2ms while the other initializer takes ~ 70 ms.

        Attachments

          Activity

            People

            Assignee:
            Unassigned Unassigned
            Reporter:
            dylansturg Dylan Sturgeon
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Dates

              Created:
              Updated: