Use GArray instead of GList when getting custom attributes from an image (#32974)
authorRyan Lucia <rylucia@microsoft.com>
Mon, 2 Mar 2020 21:46:03 +0000 (16:46 -0500)
committerGitHub <noreply@github.com>
Mon, 2 Mar 2020 21:46:03 +0000 (16:46 -0500)
commit9dec6ae2ea81d46884bf49d2df8b26cc1e28eb12
tree64716b76f6492ad53a48f8683b41b5ad03ebaab5
parente3ffd343ad5bd3a999cb9515f59e6e7a777b2c34
Use GArray instead of GList when getting custom attributes from an image (#32974)

Xamarin.Forms calls this _constantly_ during startup, to the point where the malloc calls were actually showing up in the profile. This should help with that, and gives us some ms back during startup.
There are also a bunch of calls that return empty arrays, which in theory could be created in managed for a perf boost. However, it seems the Xamarin.Android team has mostly gotten rid of those calls and that optimization would complicate the code and require changes to our managed CustomAttribute implemented for both legacy and netcore, so I've opted to not check it in for now. If the empty calls continue to show up down the line, I can dig the code back up from my local branch and PR it separately.
src/mono/mono/metadata/custom-attrs.c