Skip to content

Reducing object allocations #537

Closed
Closed
@lburgazzoli

Description

@lburgazzoli

While looking at the event handling I noticed that there a number of object allocation that happening, as example:

new Event -> new ExecutionScope -> new Context(new EventList) 

Looking at the code, it seems to me that the ExecutionScope and Context are in essence the same same object as they carry the same information so wonder if we should reduce the number of object we allocate by having the event handling generating an object implementing Context and skipping the intermediate ExecutionScope. Also I wonder if the wrapping of the events in an EventList should be dropped as it does only addition is the getLatestOfType method which can probably be moved to the Context interface or provided as an utility class.

Relates to:

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