Skip to content
This repository has been archived by the owner on May 14, 2024. It is now read-only.

Trace slows app launch time when using Xcode SPM #82

Open
mackoj opened this issue Aug 5, 2021 · 1 comment
Open

Trace slows app launch time when using Xcode SPM #82

mackoj opened this issue Aug 5, 2021 · 1 comment
Assignees
Labels
help wanted Extra attention is needed

Comments

@mackoj
Copy link

mackoj commented Aug 5, 2021

Your environment:

  • Xcode version: 12.5.1
  • Trace SDK version: 1.7.36
  • Installation method: SPM
  • iOS Version: 14.7.1
  • test device: iPhone 12

Steps to reproduce:

I did notice a slowdown of our app since I added the Trace SDK.

I used DYLD_PRINT_STATISTICS(App Launch Time: 7 tips to increase performance) in order to print information about the app start.

The name of our app binary is Sambot.

The difference is huge between when I have the Trace SDK in the app and when I don't have it.

with Trace SDK

Total pre-main time: 461.11 milliseconds (100.0%)
         dylib loading time: 148.26 milliseconds (32.1%)
        rebase/binding time:  90.55 milliseconds (19.6%)
            ObjC setup time:   3.49 milliseconds (0.7%)
           initializer time: 218.80 milliseconds (47.4%)
           slowest intializers :
    libMainThreadChecker.dylib :  16.93 milliseconds (3.6%)
                        Sambot : 374.92 milliseconds (81.3%)

without Trace SDK

Total pre-main time: 286.37 milliseconds (100.0%)
         dylib loading time: 158.84 milliseconds (55.4%)
        rebase/binding time:  30.61 milliseconds (10.6%)
            ObjC setup time:  11.49 milliseconds (4.0%)
           initializer time:  85.41 milliseconds (29.8%)
           slowest intializers :
             libSystem.B.dylib :  12.93 milliseconds (4.5%)
   libBacktraceRecording.dylib :   9.03 milliseconds (3.1%)
    libMainThreadChecker.dylib :  36.37 milliseconds (12.7%)
                        Sambot :  21.25 milliseconds (7.4%)
env name time(ms)
with Trace SDK pre-main 461.11
with Trace SDK dylib loading 148.26
with Trace SDK rebase/binding 90.55
with Trace SDK ObjC setup 3.49
with Trace SDK initializer 218.80
with Trace SDK libMainThreadChecker.dylib 16.93
with Trace SDK Sambot 374.92
without Trace SDK pre-main 286.37
without Trace SDK dylib loading 158.84
without Trace SDK rebase/binding 30.61
without Trace SDK ObjC setup 11.49
without Trace SDK initializer 85.41
without Trace SDK libSystem.B.dylib 12.93
without Trace SDK libBacktraceRecording.dylib 9.03
without Trace SDK libMainThreadChecker.dylib 36.37
without Trace SDK Sambot 21.25

Can you improve it ?

@shams-ahmed
Copy link
Contributor

@mackoj I'm aware SPM is slower than other integration such as Cocoapods. This is mainly due to how we structured the SDK, internal dependencies layout, and some limitations on the SPM side.

However, with the recent changes, I'm sure we can concatenate some of the dependencies together that should improve the overall launch time. I've added this to our backlog

@shams-ahmed shams-ahmed self-assigned this Aug 10, 2021
@shams-ahmed shams-ahmed added the help wanted Extra attention is needed label Aug 10, 2021
@shams-ahmed shams-ahmed changed the title Trace slow the app start by a lot Trace slows app launch time when using Xcode SPM Aug 20, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants