Commit e07ecaa
authored
generator: Cache the lld binary after extracting it from the LLVM archive (#149)
Extracting `lld` from the `llvm` archive takes about 40s on my machine, and
after the binary has been extracted a 5.5GB directory is left behind in the
`Artifacts` directory.
This change uses `tar` filters to reduce the number of files unpacked from
the archive and caches the resulting `lld` binary.
Excluding the time to download the archives, building an SDK from
Debian packages before `lld` has been cached takes about 57s on an
M3 MacBook Air. A subsequent build with `lld` cached takes about
17s.
The SDKs generated by the old and new methods are identical.
This PR adds `CacheKey` conformance to `Array`, as suggested by
@yingguqing in #106. Adding this conformance to `Range` was not
necessary in this case.
--
* generator: Adopt CacheKey conformance for [FilePath.Component]
This is needed to cache arrays of [FilePath.Component], so a subsequent commit
can cache the slow extraction of the `ld.lld` binary from the `llvm` tar archive.
This problem was also reported by @yingguqing in #106, although Range conformance
does not seem to be required to cache lld.
Suggested-by: @yingguqing
* generator: Cache the lld binary after extracting it from the LLVM archive
Extracting `lld` from the `llvm` archive takes about 40s on my
machine, and after the binary has been extracted a 5.5GB directory
is left in the `Artifacts` directory.
This change uses `tar` filters to reduce the number of files unpacked from
the archive and caches the resulting `lld` binary.
Excluding the time to download the archives, building an SDK from
Debian packages before `lld` has been cached takes about 57s on an
M3 MacBook Air. A subsequent build with `lld` cached takes about
17s.
The SDKs generated by the old and new methods are identical.1 parent 397105e commit e07ecaa
File tree
3 files changed
+56
-6
lines changed- Sources
- Helpers/Vendor/QueryEngine
- SwiftSDKGenerator
- Generator
- Queries
3 files changed
+56
-6
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
175 | 175 | | |
176 | 176 | | |
177 | 177 | | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
Lines changed: 12 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
| 14 | + | |
14 | 15 | | |
15 | 16 | | |
16 | 17 | | |
| |||
99 | 100 | | |
100 | 101 | | |
101 | 102 | | |
102 | | - | |
103 | | - | |
104 | | - | |
105 | | - | |
106 | | - | |
107 | 103 | | |
108 | 104 | | |
109 | 105 | | |
110 | | - | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
111 | 112 | | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
112 | 118 | | |
113 | 119 | | |
114 | 120 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
0 commit comments