Stream: git-cranelift

Topic: cranelift / Issue #655 Swift support


view this post on Zulip GitHub (Jan 13 2020 at 14:06):

terhechte commented on Issue #655:

I looked into this as well, out of curiosity, but I doubt that this could improve the Swift compile time in a meaningful way. The problem is that the Swift compiler still needs to emit the SIL. This process, however, is what takes up most of the completive. Consider this line of code:

let sum = [1, 2, 3].map { String($0) }.compactMap { Int($0) }.reduce(0, +)

Compiling this via swiftc takes roughly 15. seconds on my Mac:

time swiftc ./x.swift
1.24 real         1.12 user         0.10 sys

Just emitting the SIL takes roughly the same amount of time

time swiftc ./x.swift
1.16 real         1.04 user         0.08 sys

view this post on Zulip GitHub (Jan 13 2020 at 14:06):

terhechte edited a comment on Issue #655:

I looked into this as well, out of curiosity, but I doubt that this could improve the Swift compile time in a meaningful way. The problem is that the Swift compiler still needs to emit the SIL. This process, however, is what takes up most of the compiletime. Consider this line of code:

let sum = [1, 2, 3].map { String($0) }.compactMap { Int($0) }.reduce(0, +)

Compiling this via swiftc takes roughly 15. seconds on my Mac:

time swiftc ./x.swift
1.24 real         1.12 user         0.10 sys

Just emitting the SIL takes roughly the same amount of time

time swiftc ./x.swift
1.16 real         1.04 user         0.08 sys

view this post on Zulip GitHub (Feb 28 2020 at 23:25):

alexcrichton transferred Issue #655:

Hi, I'm thinking about writing a replacement for swiftc's backend that would translate from Swift Intermediate Language (SIL) to Cranelift IR and then let Cranelift do the codegen. My overall goal is to have a faster debug mode compiler for Swift. I was curious, what sort of performance speedups might I see? Are there any up-to-date benchmarks? In general, could this be a worthwhile project?


Last updated: Dec 23 2024 at 13:07 UTC