Skip to content

Improve performance using reference, not cloning #1

@mathbalduino

Description

@mathbalduino

The performance (may be) improved if the logger holds a reference to it's parent, instead of cloning the entire base fields, preHooks, postHooks and outputs slices/maps.

At the useReference branch, there's some suggestion:

type hooksChain struct {
	parent *hooksChain
	hooks  Hooks
}

If this struct is used inside the logger struct, replacing the old baseFields, preHooks/postHooks and outputs field types, they will continue to have the same behavior.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions