Possible Issue? Performance making tuples from vectors

I am posting this here first since it seems very similar to #32673, including that it only seems to affect compile time. Happy to file an issue though.

Switching to any union type makes performance far worse (as in (O(N) vs O(a lot)), but performance seems really bad even with a primitive type. I ran into this converting vectors to tuples. As mentioned in the title, it only affects compilation performance.

function mwe()
  println("first run:")
  for i ∈ 1:100:401
    basevec::Vector{Float64} = collect(1:i)
    print(i, ": ");
    @time NTuple{i, Float64}(basevec)
  end

  println("second run:")
  for i ∈ 1:100:401
    basevec::Vector{Float64} = collect(1:i)
    print(i, ": ");
    @time NTuple{i, Float64}(basevec)
  end

  println("uniontype first run")
  for i ∈ 1:18
    basevec::Vector{Union{Nothing,Float64}} = collect(1:i)
    print(i, ": ");
    @time NTuple{i, Union{Nothing,Float64}}(basevec)
  end

  println("uniontype second run")
  for i ∈ 1:18
    basevec::Vector{Union{Nothing,Float64}} = collect(1:i)
    print(i, ": ");
    @time NTuple{i, Union{Nothing,Float64}}(basevec)
  end
end
mwe()

OUTPUT:
first run:
1:   0.003144 seconds (374 allocations: 21.344 KiB)
101:   1.018068 seconds (11.59 M allocations: 449.961 MiB, 17.35% gc time)
201:   2.442065 seconds (32.31 M allocations: 1.103 GiB, 20.21% gc time)
301:   3.730947 seconds (53.76 M allocations: 1.779 GiB, 25.19% gc time)
401:   5.174973 seconds (75.22 M allocations: 2.458 GiB, 25.90% gc time)
second run:
1:   0.000005 seconds (4 allocations: 192 bytes)
101:   0.000144 seconds (4.73 k allocations: 112.609 KiB)
201:   0.000550 seconds (20.08 k allocations: 476.500 KiB)
301:   0.001353 seconds (45.43 k allocations: 1.053 MiB)
401:   0.002821 seconds (80.78 k allocations: 1.870 MiB)
uniontype first run
1:   0.006184 seconds (400 allocations: 22.969 KiB)
2:   0.025435 seconds (91.89 k allocations: 4.553 MiB)
3:   0.036117 seconds (102.80 k allocations: 4.980 MiB)
4:   0.048938 seconds (131.48 k allocations: 6.348 MiB, 18.60% gc time)
5:   0.027896 seconds (103.21 k allocations: 4.998 MiB)
6:   0.026570 seconds (104.31 k allocations: 5.048 MiB)
7:   0.028505 seconds (106.71 k allocations: 5.158 MiB)
8:   0.037016 seconds (111.91 k allocations: 5.398 MiB, 18.20% gc time)
9:   0.031446 seconds (123.10 k allocations: 5.908 MiB)
10:   0.052232 seconds (147.28 k allocations: 7.015 MiB)
11:   0.064679 seconds (199.17 k allocations: 9.391 MiB, 10.01% gc time)
12:   0.083712 seconds (310.07 k allocations: 14.484 MiB)
13:   0.152744 seconds (546.15 k allocations: 25.274 MiB, 1.77% gc time)
14:   0.298006 seconds (1.05 M allocations: 48.198 MiB, 2.01% gc time)
15:   0.582071 seconds (2.11 M allocations: 96.669 MiB, 1.22% gc time)
16:   2.939578 seconds (6.50 M allocations: 330.868 MiB, 0.47% gc time)
17:   6.231055 seconds (13.62 M allocations: 693.741 MiB, 0.39% gc time)
18:  13.599008 seconds (28.58 M allocations: 1.422 GiB, 0.34% gc time)
uniontype second run
1:   0.000004 seconds (7 allocations: 352 bytes)
2:   0.000004 seconds (8 allocations: 384 bytes)
3:   0.000010 seconds (25 allocations: 848 bytes)
4:   0.000063 seconds (46 allocations: 1.641 KiB)
5:   0.000131 seconds (68 allocations: 2.516 KiB)
6:   0.000203 seconds (91 allocations: 3.422 KiB)
7:   0.000295 seconds (115 allocations: 4.391 KiB)
8:   0.000408 seconds (140 allocations: 5.391 KiB)
9:   0.000547 seconds (166 allocations: 6.453 KiB)
10:   0.000690 seconds (193 allocations: 7.547 KiB)
11:   0.000862 seconds (221 allocations: 8.703 KiB)
12:   0.001058 seconds (250 allocations: 9.891 KiB)
13:   0.001235 seconds (280 allocations: 11.141 KiB)
14:   0.001458 seconds (311 allocations: 12.422 KiB)
15:   0.001814 seconds (343 allocations: 13.766 KiB)
16:   0.001750 seconds (376 allocations: 15.141 KiB)
17:   0.002200 seconds (410 allocations: 16.578 KiB)
18:   0.002547 seconds (445 allocations: 18.047 KiB)