Commit 334041f
Add registerPklTypes(_:) to bypass O(N) type discovery on first load (#110)
* Add registerPklTypes(_:) to bypass O(N) type discovery on first load
In large binaries, _initializeShared() scans every Swift type in the binary
via pkls_enumerateTypes and checks protocol conformance for each. For a CLI
with thousands of linked types but only ~50 Pkl types, this caused ~14s
startup latency. The new API lets callers pre-register types and skip the
scan entirely.
Co-authored-by: Cursor <cursoragent@cursor.com>
* Formatting
---------
Co-authored-by: John Liedtke <john.liedtke@walmart.com>
Co-authored-by: Jen Basch <jbasch@apple.com>1 parent ddcc2e3 commit 334041f
1 file changed
+42
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | | - | |
| 2 | + | |
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| |||
124 | 124 | | |
125 | 125 | | |
126 | 126 | | |
127 | | - | |
| 127 | + | |
128 | 128 | | |
129 | 129 | | |
130 | 130 | | |
131 | 131 | | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
132 | 172 | | |
0 commit comments