Skip to content
This repository has been archived by the owner on Nov 1, 2020. It is now read-only.

Speed up typeof(Foo) and Object.GetType by 50+% #8095

Merged
merged 3 commits into from
Apr 20, 2020

Commits on Apr 18, 2020

  1. Speed up typeof(Foo) and Object.GetType by 50+%

    This adds a general purpose concept of "writable data" to the EEType data structure. This points to a block of memory whose purpose is defined by the class library (we can potentially cache all sorts of stuff there).
    
    The writable data is used to hold a GC handle to the runtime `System.Type` instance associated with the EEType. This bypasses the hashtable lookup that has been used before.
    
    I'm seeing more than 50% TP improvement against best case scenarios with the hashtable (best case defined as "the thing we're looking for is the first entry in the hashtable bucket").
    
    Both CoreCLR and Mono use a similar approach. CoreRT was lagging in perf because of the hashtable lookup: this brings us much closer. We're still not as fast as CoreCLR, but getting faster than this would have impacts elsewhere (in terms of working set and size on disk). The implementation I chose for CoreRT (optional relative pointer field) has minimal working set impact.
    MichalStrehovsky committed Apr 18, 2020
    Configuration menu
    Copy the full SHA
    3ac36da View commit details
    Browse the repository at this point in the history

Commits on Apr 19, 2020

  1. Review feedback

    MichalStrehovsky committed Apr 19, 2020
    Configuration menu
    Copy the full SHA
    b47ad89 View commit details
    Browse the repository at this point in the history

Commits on Apr 20, 2020

  1. Bump ObjectWriter

    MichalStrehovsky committed Apr 20, 2020
    Configuration menu
    Copy the full SHA
    2b866ba View commit details
    Browse the repository at this point in the history