Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Skip unnecessary file reading at startup #1334

Merged
merged 1 commit into from
Apr 11, 2022

Conversation

nickdowell
Copy link
Contributor

@nickdowell nickdowell commented Apr 11, 2022

Goal

Improve notifier start time by doing less work.

Changeset

Defers reading config.json, metadata.json and state.json until building an OOM or Thermal Kill event (if detected) rather than reading them in -[BugsnagClient initWithConfiguration:].

Testing

Verified by running E2E tests locally - in particular features/barebone_tests.feature:190 and features/out_of_memory.feature:11 that ensure various items are correctly set in the payload, and running a full E2E on iOS 10 on CI.

@github-actions
Copy link

Bugsnag.framework binary size decreased by 2,280 bytes from 854,936 to 852,656 🎉

    FILE SIZE        VM SIZE    
 --------------  -------------- 
  [ = ]       0   +17% +2.23Ki    [__LINKEDIT]
  +4.2%    +710  +4.2%    +710    [__TEXT]
   +22%    +576  +6.9%    +576    [__DATA]
  +3.6%    +140  +3.6%    +140    __TEXT,__gcc_except_tab
  -0.4%      -8  -0.4%      -8    Function Start Addresses
  -0.7%     -16  -0.7%     -16    Rebase Info
  -2.2%     -24  -2.2%     -24    __DATA,__objc_ivar
  -0.7%     -48  -0.7%     -48    __DATA,__objc_selrefs
  -0.1%    -236  -0.1%    -236    __TEXT,__text
  -0.9%    -504  -0.9%    -504    __DATA,__objc_const
  -2.0%    -614  -2.0%    -614    __TEXT,__objc_methname
  -0.6%    -912  -0.6%    -912    Symbol Table
  -0.7% -1.31Ki  -0.7% -1.31Ki    String Table
  -0.3% -2.23Ki  [ = ]       0    TOTAL

Generated by 🚫 Danger

@nickdowell nickdowell merged commit b4e3628 into next Apr 11, 2022
@nickdowell nickdowell deleted the nickdowell/skip-file-reading branch April 11, 2022 14:42
@nickdowell nickdowell mentioned this pull request Apr 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants