Commit ac175e2
authored
gimli: Implement symbol table searches on macOS (#300)
If dwarf debug info isn't available we fall back to searching the symbol
table. Typically this is done with `dladdr` on most platforms but with
gimli we typically have all the infrastructure already in place to do
the search ourselves. This functionality was already filled out on
Linux and Windows, but it wasn't implemented on macOS yet because it
wasn't necessary.
Implementing a pretty simple version, however, shows substantial
speedups for the various benchmarks. Presumably `dladdr` isn't exactly
the fastest thing in the world and our sorted list search which is
cached must be much faster here!
The current comparison of before/after this change looks like:
```
name before ns/iter after ns/iter diff ns/iter diff % speedup
new 81,472 9,047 -72,425 -88.90% x 9.01
new_unresolved 2,126 2,009 -117 -5.50% x 1.06
new_unresolved_and_resolve_separate 82,252 9,134 -73,118 -88.90% x 9.01
trace 1,273 1,185 -88 -6.91% x 1.07
trace_and_resolve_callback 67,403 2,123 -65,280 -96.85% x 31.75
trace_and_resolve_separate 76,452 2,822 -73,630 -96.31% x 27.09
```1 parent c5f56d1 commit ac175e2
1 file changed
+18
-7
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
158 | 158 | | |
159 | 159 | | |
160 | 160 | | |
| 161 | + | |
161 | 162 | | |
162 | 163 | | |
163 | 164 | | |
| |||
171 | 172 | | |
172 | 173 | | |
173 | 174 | | |
174 | | - | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
175 | 185 | | |
176 | 186 | | |
177 | 187 | | |
| |||
194 | 204 | | |
195 | 205 | | |
196 | 206 | | |
197 | | - | |
198 | | - | |
199 | | - | |
200 | | - | |
201 | | - | |
202 | | - | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
203 | 214 | | |
204 | 215 | | |
205 | 216 | | |
| |||
0 commit comments