Why is Swift so slow (timeout) in compiling this code?

I filed a number of bugs some time ago about this issue:

In particular (some are somewhat fixed):

You can see the quadratic complexity in this diagram:

It's quite common in rendering to include precomputed arrays:

I'd be interested in hearing about those. I can think of two:

  1. Read JSON as above. Disadvantages: a) Has to be done every time b) Can't be deployed as a single binary.
  2. Use another language (C, C++). Disadvantage: Clumsy.

Since the bugs are years old I wouldn't bet my hat on it.

4 Likes