Results on my machine (I can’t see order of magnitude slow down)
julia> @btime v1($D, Val(4))
16.125 μs (4 allocations: 31.75 KiB)
(0.6448711574501893, 0.2574365553023608, 0.15220038582379217, 0.10580079514815209)
julia> @btime v2($D, Val(4))
3.365 μs (0 allocations: 0 bytes)
(0.6448711574501889, 0.25743655530236076, 0.15220038582379197, 0.10580079514815198)
julia> @btime v3($D, Val(4))
3.458 μs (0 allocations: 0 bytes)
(0.6448711574501889, 0.25743655530236076, 0.15220038582379197, 0.10580079514815198)
julia> @btime v1($D, Val(30))
318.875 μs (30 allocations: 238.12 KiB)
(0.6448711574501893, 0.2574365553023608, 0.15220038582379217, 0.10580079514815209, 0.08017002510945055, 0.06410806936660542, 0.05320097597224929, 0.04536635637370755, 0.03949783153807502, 0.03495613511968046, 0.031347930888187145, 0.028418959158835428, 0.025998145904505637, 0.02396649158751632, 0.022238857123897404, 0.0207528423483709, 0.019461747651250177, 0.01832997970811076, 0.017329970351146754, 0.01644006032068933, 0.015643014586369287, 0.01492496081474157, 0.014274617330067178, 0.013682722898519838, 0.01314160963951319, 0.012644879028781236, 0.012187153219416135, 0.011763882112192241, 0.011371192189755026, 0.011005766987281907)
julia> @btime v2($D, Val(30))
17.791 μs (0 allocations: 0 bytes)
(0.6448711574501889, 0.25743655530236076, 0.15220038582379197, 0.10580079514815198, 0.08017002510945062, 0.06410806936660547, 0.05320097597224934, 0.04536635637370749, 0.03949783153807499, 0.0349561351196805, 0.031347930888187166, 0.028418959158835418, 0.025998145904505606, 0.02396649158751633, 0.0222388571238974, 0.0207528423483709, 0.019461747651250163, 0.01832997970811077, 0.017329970351146758, 0.016440060320689332, 0.015643014586369283, 0.014924960814741576, 0.014274617330067184, 0.01368272289851984, 0.01314160963951317, 0.012644879028781213, 0.012187153219416118, 0.011763882112192226, 0.01137119218975503, 0.01100576698728192)
julia> @btime v3($D, Val(30))
28.458 μs (0 allocations: 0 bytes)
(0.6448711574501889, 0.25743655530236076, 0.15220038582379197, 0.10580079514815198, 0.08017002510945062, 0.06410806936660547, 0.05320097597224934, 0.04536635637370749, 0.03949783153807499, 0.0349561351196805, 0.031347930888187166, 0.028418959158835418, 0.025998145904505606, 0.02396649158751633, 0.0222388571238974, 0.0207528423483709, 0.019461747651250163, 0.01832997970811077, 0.017329970351146758, 0.016440060320689332, 0.015643014586369283, 0.014924960814741576, 0.014274617330067184, 0.01368272289851984, 0.01314160963951317, 0.012644879028781213, 0.012187153219416118, 0.011763882112192226, 0.01137119218975503, 0.01100576698728192)