• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: which pages of the file are in the cache
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: which pages of the file are in the cache


  • Subject: Re: which pages of the file are in the cache
  • From: Eric Gouriou <email@hidden>
  • Date: Thu, 20 Aug 2009 09:46:25 -0700


On Aug 20, 2009, at 4:04 AM, Joel Reymont wrote:
I decided to step back for a second and run 'dapptrace -deoFU' to see what's going on.

The trace looks like this:

---
RELATIVE  ELAPSD    CPU CALL(args) = return
   2083       .      .                                     -> dyld:ImageLoaderMachOCompressed::segmentCommandOffsets() const(0x8FE467C8, 0x0, 0xBFFFC608)
   2084      71      1                                     <- dyld:ImageLoaderMachOCompressed::segmentCommandOffsets() const = 10

...

-> LaunchServices:_LSGetExtensionInfo(0xBFFFD00E, 0xD, 0xBFFFD224)
4004630      31      2                                                                                                                                                                                                                                                                       <- LaunchServices:_LSGetExtensionInfo = 332
4004633       .      .                                                                                                                                                                                                                                                                       -> LaunchServices:_LSCanSetExtensionHidden(0xBFFFE614, 0x1B06CF0, 0xBFFFD224)
4004635      37      2                                                                                                                                                                                                                                                                       <- LaunchServices:_LSCanSetExtensionHidden = 94
---

Does this mean that 4s are spent in the dynamic linking phase?

The list of shared libraries used by firefox-bin and XUL is very large (below).

Running 'otool -l' I see nindirectsyms 7076 in the LC_DYSYMTAB section of XUL.

Am I correct that 4s are being spent in the dynamic linking and "system startup" phase?

 This seems quite high for the dynamic linking phase. Is this for a cold launch or a warm one ?
I can't tell what you include in the "system startup" phase.

 To get a better idea of how long the dynamic linking takes, I recommend using DYLD_PRINT_STATISTICS
(see man dyld). It is best to set it via LSEnvironment in the Info.plist, use the regular launch methods (Dock, Finder,
open Firefox.app, etc.) and check the output in system.log.  You can also launch the application from the command line
however you'll have to be careful to check the normal launch method from time to time.

In Info.plist:
<key>LSEnvironment</key>
<dict>
<key>DYLD_PRINT_STATISTICS</key>
<string>1</string>
</dict>


Quick experiment:
% DYLD_PRINT_STATISTICS=1 Firefox.app/Contents/MacOS/firefox-bin
total time: 516.88 milliseconds (100.0%)
total images loaded:  114 (100 from dyld shared cache, 0 needed no fixups)
total segments mapped: 52, into 4202 pages with 635 pages pre-fetched
total images loading time: 140.86 milliseconds (27.2%)
total dtrace DOF registration time: 0.09 milliseconds (0.0%)
total rebase fixups:  139,943
total rebase fixups time: 63.92 milliseconds (12.3%)
total binding fixups: 4,650
total binding symbol lookups: 1,024, average images searched per symbol: 0.4
total binding fixups time: 19.47 milliseconds (3.7%)
total weak binding fixups time: 0.38 milliseconds (0.0%)
total bindings lazily fixed up: 70 of 4,849
total initializer time: 292.13 milliseconds (56.5%)
total symbol trie searches:    1187
total symbol table binary searches:    460
total images defining/using weak symbols:  2/42

What actions can I take to speed things up if so?

 Reduce the number of individual libraries, move more of the logic into the main executable.

 Remove load-time initializers (reduce their number, make them compile-time constants or move
 them into static initializers in accessor functions to get them lazily executed)

 Define order files to have the symbols linked in their order of execution to reduce paging costs.

 Reduce the amount of imported/exported symbols (use export lists, reduce API surface).

 Trim the amount of code executed at launch time.

 Make more of the launch asynchronous / parallel.

   Eric

Thanks, Joel

P.S.

firefox-bin:
/System/Library/Frameworks/Cocoa.framework/Versions/A/Cocoa (compatibility version 1.0.0, current version 12.0.0)
@executable_path/XUL (compatibility version 1.0.0, current version 1.0.0)
@executable_path/libmozjs.dylib (compatibility version 1.0.0, current version 1.0.0)
@executable_path/libxpcom.dylib (compatibility version 1.0.0, current version 1.0.0)
@executable_path/libplds4.dylib (compatibility version 1.0.0, current version 1.0.0)
@executable_path/libplc4.dylib (compatibility version 1.0.0, current version 1.0.0)
@executable_path/libnspr4.dylib (compatibility version 1.0.0, current version 1.0.0)
/System/Library/Frameworks/Carbon.framework/Versions/A/Carbon (compatibility version 2.0.0, current version 136.0.0)
/System/Library/Frameworks/CoreAudio.framework/Versions/A/CoreAudio (compatibility version 1.0.0, current version 1.0.0)
/System/Library/Frameworks/AudioToolbox.framework/Versions/A/AudioToolbox (compatibility version 1.0.0, current version 1.0.0)
/System/Library/Frameworks/AudioUnit.framework/Versions/A/AudioUnit (compatibility version 1.0.0, current version 1.0.0)
/System/Library/Frameworks/AddressBook.framework/Versions/A/AddressBook (compatibility version 1.0.0, current version 700.0.0)
/usr/lib/libstdc++.6.dylib (compatibility version 7.0.0, current version 7.4.0)
/usr/lib/libgcc_s.1.dylib (compatibility version 1.0.0, current version 1.0.0)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 111.1.4)
---

and

---
XUL:
@executable_path/XUL (compatibility version 1.0.0, current version 1.0.0)
/System/Library/Frameworks/Cocoa.framework/Versions/A/Cocoa (compatibility version 1.0.0, current version 12.0.0)
@executable_path/libsqlite3.dylib (compatibility version 1.0.0, current version 1.0.0)
@executable_path/libmozjs.dylib (compatibility version 1.0.0, current version 1.0.0)
@executable_path/libsmime3.dylib (compatibility version 1.0.0, current version 1.0.0)
@executable_path/libssl3.dylib (compatibility version 1.0.0, current version 1.0.0)
@executable_path/libnss3.dylib (compatibility version 1.0.0, current version 1.0.0)
@executable_path/libnssutil3.dylib (compatibility version 1.0.0, current version 1.0.0)
@executable_path/libsoftokn3.dylib (compatibility version 1.0.0, current version 1.0.0)
@executable_path/libmozz.dylib (compatibility version 1.0.0, current version 1.0.0)
/usr/lib/libcups.2.dylib (compatibility version 2.0.0, current version 2.8.0)
@executable_path/libplds4.dylib (compatibility version 1.0.0, current version 1.0.0)
@executable_path/libplc4.dylib (compatibility version 1.0.0, current version 1.0.0)
@executable_path/libnspr4.dylib (compatibility version 1.0.0, current version 1.0.0)
/System/Library/Frameworks/SystemConfiguration.framework/Versions/A/SystemConfiguration (compatibility version 1.0.0, current version 212.2.0)
/System/Library/Frameworks/QuickTime.framework/Versions/A/QuickTime (compatibility version 1.0.0, current version 1290.0.0)
/System/Library/Frameworks/IOKit.framework/Versions/A/IOKit (compatibility version 1.0.0, current version 275.0.0)
/usr/lib/libcrypto.0.9.7.dylib (compatibility version 0.9.7, current version 0.9.7)
/System/Library/Frameworks/Carbon.framework/Versions/A/Carbon (compatibility version 2.0.0, current version 136.0.0)
/System/Library/Frameworks/CoreAudio.framework/Versions/A/CoreAudio (compatibility version 1.0.0, current version 1.0.0)
/System/Library/Frameworks/AudioToolbox.framework/Versions/A/AudioToolbox (compatibility version 1.0.0, current version 1.0.0)
/System/Library/Frameworks/AudioUnit.framework/Versions/A/AudioUnit (compatibility version 1.0.0, current version 1.0.0)
/System/Library/Frameworks/AddressBook.framework/Versions/A/AddressBook (compatibility version 1.0.0, current version 700.0.0)
/usr/lib/libstdc++.6.dylib (compatibility version 7.0.0, current version 7.4.0)
/usr/lib/libgcc_s.1.dylib (compatibility version 1.0.0, current version 1.0.0)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 111.1.4)
/usr/lib/libobjc.A.dylib (compatibility version 1.0.0, current version 227.0.0)
/System/Library/Frameworks/CoreServices.framework/Versions/A/CoreServices (compatibility version 1.0.0, current version 32.0.0)
/System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation (compatibility version 150.0.0, current version 476.18.0)
/System/Library/Frameworks/ApplicationServices.framework/Versions/A/ApplicationServices (compatibility version 1.0.0, current version 34.0.0)
/System/Library/Frameworks/Foundation.framework/Versions/C/Foundation (compatibility version 300.0.0, current version 677.24.0)
/System/Library/Frameworks/AppKit.framework/Versions/C/AppKit (compatibility version 45.0.0, current version 949.46.0)

---
faster mac firefox
 http://tinyco.de

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: which pages of the file are in the cache
      • From: Joel Reymont <email@hidden>
    • Re: which pages of the file are in the cache
      • From: Joel Reymont <email@hidden>
References: 
 >Re: which pages of the file are in the cache (From: Michael Smith <email@hidden>)
 >Re: which pages of the file are in the cache (From: Joel Reymont <email@hidden>)

  • Prev by Date: Re: List of accounts
  • Next by Date: CFFileDescriptor fd leak?
  • Previous by thread: Re: which pages of the file are in the cache
  • Next by thread: Re: which pages of the file are in the cache
  • Index(es):
    • Date
    • Thread