Skip to content

Use lazy logging for non-constant strings #3

@MrBergin

Description

@MrBergin

There's places in Cobalt (e.g. BaseProperty.onChange) that would benefit from switching to their lazy logging counterparts, e.g:

logger.debug("Subscribing to changes to property: $this.")

Should be

logger.debug { "Subscribing to changes to property: $this." }

I can't speak for the JVM implementation of uuid, but when looking at performance in the browser for Zircon I could see a fair chunk of time spent in uuid.toString() and garbage collecting strings which went away when using lazy logging and turning debug off.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions