Skip to content

Deferred object destruction for shared_ptr #111

@ohhmm

Description

@ohhmm

Once during profiling, I noticed that deletion has major performance impact.
Since I don't rely on object under shared_ptr destruction end, I decided to defer the destruction to increase overall performance of getting results.
My solution looks like this: void DispatchDispose(std::shared_ptr<void>&&);: https://github.com/ohhmm/openmind/blob/d2a58112b8e341e8733466e9710feb2ce11d882d/omnn/rt/GC.h#L19

My thought was about that in fact hardly anyone rely on last shared_ptr deletion end to continue code execution. Its only goal is to cleanup resource, but it does not matter when.

I guess that may be useful to have resource cleanup governors for shared_ptr or new kind of smart pointers for this.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions