uber / nanoscope-art

Apache License 2.0
49 stars 13 forks source link

Trace class loading #2

Closed AttwellBrian closed 6 years ago

AttwellBrian commented 6 years ago

Profile methods inside ClassLinker known to be slow as well as a few other methods I am interested in. I made sure to break out the linking/verification/loading/initialize calls since these are main categories of class loading time.

For the DefineClass method, I also include metadata for the class name being loaded. The out.txt file will contain lines that look like

    Class ClassLinker.DefineClass()#Lcom/ubercab/presidio/app/core/root/main/ride/request/confirmation/location/ConfirmationLocationUtils;

The tracer will now look like the following

screen shot 2018-03-02 at 3 11 28 pm screen shot 2018-03-02 at 3 11 11 pm

Background on Class Loading Class loading is comprised of the following steps Loading (get pointer to memory mapped dex file. this step will sometimes require paging into memory), Linking (integrates data structures from loading into runtime), Static Initialization (running static initializers) and Verification (verify correctness of code. sometimes requires going back to dex file so can contain IO).

Leland-Takamine commented 6 years ago

Looks good once comment docs are added.