util: possible way to speed up util.format() #5285
Labels
performance
Issues and PRs related to the performance of Node.js.
util
Issues and PRs related to the built-in util module.
Hi guys. While I was looking at sources... I found that
util.format()
is based onString#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.:
indexOf('%')
indexOf('%')
Or, explain plz why it would not give actual speedup.
The text was updated successfully, but these errors were encountered: