Skip to content

util: possible way to speed up util.format() #5285

Closed
@estliberitas

Description

@estliberitas

Hi guys. While I was looking at sources... I found that util.format() is based on String#replace() with "replacer" function.

I am wondering if anyone has experimented with automata-based solution maybe composed with String#indexOf('%') (for faster moving from one char sequence to another).

If no, would you be interested in such an implementation? I'd benchmark following impls.:

  • automata w/ indexOf('%')
  • automata w/o indexOf('%')

Or, explain plz why it would not give actual speedup.

Metadata

Metadata

Assignees

No one assigned

    Labels

    performanceIssues and PRs related to the performance of Node.js.utilIssues and PRs related to the built-in util module.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions