Skip to content

Evaluate performance impact of making Model::resolve non-virtual #39

@josephbirkner

Description

@josephbirkner

Instead of using virtual resolve-function overloads for every derived Model class, we can switch to a lookup-table based approach, where each Node column class has a static NodeClass::resolve(Model*, ModelNode const& n, void* stackMemory) function which is registered in a 256-element array (one slot per possible column type). The registration is done using a new Model::register(columnType, derivedNodeSize, resolveSlotCallback) function. A resolve-slot-function will need to initialize a ModelNode-derived class in-place onto stackMemory, which is always as big as the biggest derivedNodeSize.

Now, the Model::resolve function could also be a template, such that the resolve-callback does not need to be virtual anymore.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions