Skip to content

Optimize ValueInstantiator construction for default Collection, Map types #2416

@cowtowncoder

Description

@cowtowncoder

Based on profiling it looks like attempts to discover creator for default Collection (ArrayList) and Map (LinkedHashMap) types is a huge time sink, even thought actual creator in both cases will just be the default constructor. While this lookup cost is usually amortized across many calls it is a problem for cold-start case, including usage on Android platform, Lambda services and possibly some stream processing (spark streaming?).
The main reason is that some common usage (such as binding as "untyped" (nominal type of java.lang.Object) or as List / Map) will use this codepath.

So let's see handling can be changed to short-cut these 2 common cases.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions