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

Reduce time needed to compile this snippet containing Array of Array

    XMLWordPrintable

    Details

      Description

      Tested with Xcode 8.3 default toolchain (Swift 3.1) and also dev snapshot 2017-06-02 (Swift 4), both are exceptionally slow at compiling this program (8 seconds on my MBP):

      var maa = [[Int]]()
      let i = 1
      let j = 2
      #if HELPING_TYPE_CHECKER
          let a = maa[i + 1][j - 1]
          let b = maa[i - 1][j + 1]
          maa[i][j] = a + b
      #else
          maa[i][j] = maa[i + 1][j - 1] + maa[i - 1][j + 1]
      #endif
      
      $ time swiftc -D HELPING_TYPE_CHECKER test.swift
      real	0m0.151s
      user	0m0.114s
      sys	0m0.024s
      
      $ time swiftc test.swift
      real	0m8.595s
      user	0m8.277s
      sys	0m0.302s
      

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              jens Jens Persson
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: