Skip to content

Deprecate log message function syntax in favor of concatenation of params #108

@ibgreen

Description

@ibgreen

using inline functions for conditional logging take 2-3x more time than unconditionally building strings.

Looks like the function parameter style does not provide the intended performance benefits, see visgl/deck.gl#3949

Proposals:

  • modify the various log calls to take multiple string segment as parameters and concat them inside the log functions when logging actually happens. That should create no objects and parameter passing is really fast in modern JS engines.
  • consider dropping the function parameter feature from probe if it does not provide expected performance benefits (throw or warn if function parameter is passed).
log.info(() => `releasing ${id}`) // old, expensive inline function with variable capture
log.info(`releasing `, id) // new, fast parameter passing, string concatenation happens only of logging enabled.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions