Philipp Hofmann
Philipp Hofmann
Hey, @markuswahl-2, sorry, no didn't get to that yet. Try to do it this week.
Thanks for pointing this out, @vaind. It totally makes sense.
So this will be fixed by https://github.com/getsentry/sentry-cocoa/pull/1926, @armcknight?
We could add a cache here https://github.com/getsentry/sentry-cocoa/blob/055a5200ccd4bf9d27305f0d9574fbcc8e5900f0/Sources/Sentry/SentryDebugImageProvider.m#L39-L51 Worth pointing out that this is called for every capture call. Before we do that, we should investigate how heavy the call to...
Some quick research tells me it takes around 5 ms on a MacBook Air with M1, which is unacceptable. We should implement a cache.
Inside SentryCrash we call `_dyld_image_count()`. The [docs state](https://developer.apple.com/library/archive/documentation/System/Conceptual/ManPages_iPhoneOS/man3/dyld.3.html) > _dyld_image_count() returns the current number of images mapped in by > dyld. Note that using this count to iterate all images...
We could use _dyld_register_func_for_add_image and _dyld_register_func_for_remove_image to be notified when new images are added or removed o invalidate the cache. We already use the first function here https://github.com/getsentry/sentry-cocoa/blob/e47eea57ef97e9b1a949a230b74219587619c33f/Sources/SentryCrash/Recording/Tools/fishhook.c#L260
Doing this properly could fix https://github.com/getsentry/sentry-cocoa/issues/1892.
Blocked by https://github.com/getsentry/sentry-cocoa/issues/1892, see https://github.com/getsentry/sentry-cocoa/pull/1965#issuecomment-1237080465. Please reopen https://github.com/getsentry/sentry-cocoa/pull/1965 when tackling this issue, as it has some helpful information.
I think for CPU usage, we need to keep track of wall and CPU time. If you don't know the difference, please check https://en.wikipedia.org/wiki/Elapsed_real_time. @armcknight, I'm pretty sure we already...