Upgrade to Pro — share decks privately, control downloads, hide ads and more …

今すぐできる、ユーザーとチームのためのiOS速度改善 / Gunosy Kaizen Nigh...

今すぐできる、ユーザーとチームのためのiOS速度改善 / Gunosy Kaizen Night iOS development optimization

Gunosy カイゼン Night #1の発表資料です。

Seiji Takahashi

August 10, 2017
Tweet

More Decks by Seiji Takahashi

Other Decks in Programming

Transcript

  1. ࣗݾ঺հ • Github: timakin / Twitter: @__timakin__ • Contributor of

    Go / golang.tokyo / roppongi-golunch • Gunosy ৽نࣄۀ։ൃࣨ ॴଐ • Go / Swift • Recently Contributed / Created • giginet/xcprofiler • mercari/gaurun • timakin/gopli • timakin/ssm2env • timakin/md2mid • timakin/autocompl
  2. • ਓੜແବײ͋ͬͯΞϓϦ࢖Θͳ͘ͳΔ • ࡶΞϓϦײ͋ͬͯ։ൃνʔϜͷαϙʔτ͕ෆ҆ • ৘ใ͕ܽམͯ͠Πϥͭ͘ • ଴ͬͯΔؒʹbackground -> ଞͷΞϓϦʹભҠ͠

    ͯ໭Δͷ๨ΕΔ • ڝ߹ΞϓϦͱѱ͍఺Λൺ΂ΒΕΔධՁϦεΫ • αʔϏεͷࢮ ஗͍ͱى͜Δ͜ͱɿΞϓϦମݧฤ
  3. • Too many dylibs • Too many class/method declarations •

    Too many initializers ىಈ͕஗͘ͳΔݪҼ
  4. • Too many dylibs • Too many class/method declarations •

    Too many initializers • SDK ىಈ͕஗͘ͳΔݪҼ
  5. • Too many dylibs • Too many class/method declarations •

    Too many initializers • SDK • API Call ىಈ͕஗͘ͳΔݪҼ
  6. • Too many dylibs • Too many class/method declarations •

    Too many initializers • SDK • API Call • Middleware ىಈ͕஗͘ͳΔݪҼ
  7. ىಈܭଌ • Instruments • Time Profiler • Static Initializer Calls


    (iOS11 / Mac OS High Sierra) • DYLD_PRINT_STATISTICS
  8. DYLD_PRINT_STATISTICS Total pre-main time: 2.5 seconds (100.0%) dylib loading time:

    1.3 seconds (54.0%) rebase/binding time: 111.49 milliseconds (4.3%) ObjC setup time: 432.17 milliseconds (16.9%) initializer time: 631.54 milliseconds (24.7%) slowest intializers : libSystem.B.dylib : 22.83 milliseconds (0.8%) xxx-ios : 500.72 milliseconds (19.5%)
  9. վળํ๏ • ܕਪ࿦ආ͚Δ
 ʢClosure໭Γ஋, Variableએݴ౳ʣ • ϝιουνΣΠϯආ͚ΔʢҰ࣌ม਺ʹ֨ೲʣ • ഑ྻ݁߹(don’t +,

    append) • `??` ΍ࡾ߲ԋࢉࢠ࢖Θͳ͍ • lazy propertiesͷϓϥΠϕʔτϝιουԽ • ObjectMapperۃྗ࢖Θͳ͍
  10. վળํ๏ • ܕਪ࿦ආ͚Δ
 ʢClosure໭Γ஋, Variableએݴ౳ʣ • ϝιουνΣΠϯආ͚ΔʢҰ࣌ม਺ʹ֨ೲʣ • ഑ྻ݁߹(don’t +,

    append) • `??` ΍ࡾ߲ԋࢉࢠ࢖Θͳ͍ • lazy propertiesͷϓϥΠϕʔτϝιουԽ • ObjectMapperۃྗ࢖Θͳ͍ • CocoaPodsΛv1.3.0Ҏ্ʹΞοϓάϨʔυ͢Δ
  11. վળํ๏ • ܕਪ࿦ආ͚Δ
 ʢClosure໭Γ஋, Variableએݴ౳ʣ • ϝιουνΣΠϯආ͚ΔʢҰ࣌ม਺ʹ֨ೲʣ • ഑ྻ݁߹(don’t +,

    append) • `??` ΍ࡾ߲ԋࢉࢠ࢖Θͳ͍ • lazy propertiesͷϓϥΠϕʔτϝιουԽ • ObjectMapperۃྗ࢖Θͳ͍ • CocoaPodsΛv1.3.0Ҏ্ʹΞοϓάϨʔυ͢Δ