Skip to content

Agile factories are cached #1

Open
@jonwis

Description

@jonwis

@oldnewthing points out that this:

While this model reduces the idiomatic elegance of C++/WinRT’s projection, it greatly reduces binary footprint. Instead of each “.Create()” being a fetch of the property cache, an addref of it, a call, and a releae, it’s a single call per line with the fetch-and-release applied once in the sequence.

... is not correct for agile factories; once the factory has been cached it's a "look at cache then call." Which still requires looking at the cache and calling, potentially also fetching the factory into the cache. See https://github.com/microsoft/cppwinrt/blob/bf4459b25aeeb7093e8262fb3b29ca70b0ab2e60/strings/base_activation.h#L393 for where it can skip the addref/release on the factory itself.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions