getsentry / sentry-unity

Development of Sentry SDK for Unity
https://docs.sentry.io/platforms/unity/
MIT License
206 stars 51 forks source link

libil2cpp.so file increased a lot in size, this expected? #1113

Open hajimeku opened 1 year ago

hajimeku commented 1 year ago

Environment

How do you use Sentry? Sentry Saas

Which version of the SDK? 0.26

How did you install the package? (Git-URL, Assetstore) Git-URL

Which version of Unity? 2021.3.10

Is this happening in Unity (editor) or on a player like Android, iOS, Windows? Android

Steps to Reproduce

Make an android build

Expected Result

Smaller build size

Actual Result

big build size

Any logs or screenshots

The left is a build without sentry, the right is with sentry image

bitsandfoxes commented 1 year ago

Thanks for pointing this out. I was definitely expecting an increase in size but not of this much. Unfortunately, we have to target netstandard2.0 which leads to quite a few dependencies. And I don't expect the aliasing we do on those dependencies to do us any favours either.

hajimeku commented 1 year ago

Well, thats something we will have to deal with then. it's been amazing reporting some very difficult crashes so far. Keep it up.

vaind commented 1 year ago

FYI @bitsandfoxes to track size increase (on PRs) we could use the "app binary size" metrics action from https://github.com/getsentry/action-app-sdk-overhead-metrics

Shouldn't be a big effort, it takes two APKs, one with and one without the SDK included. We would just need to reenable building the APK before Unity is added (we do that on the main branch only at the moment) and then grab those two APKs and pass it to the action. It will report the difference & also check how it changed from the main branch for a current PR. Without any more changes the action supports APKs and IPAs but for the app size metric, it would also be easy to add other platforms. Wouldn't go as far as adding support for app-startup metrics for more platforms at the moment.

hajimeku commented 1 year ago

@vaind That is a valid issue but it will not reflect the actual impact on a production project. Targeting a different framework does increase the size but the majority will be stripped by unity if you dont reference all the api's.

bitsandfoxes commented 1 year ago

it will not reflect the actual impact on a production project

Fair point. But we could consider using our integration test project for this. Since it's actually using most parts of the SDK it should give a fairly good idea of the impact we're having on the app size.