hermes icon indicating copy to clipboard operation
hermes copied to clipboard

Speed up Array.prototype.join()

Open tmikov opened this issue 10 months ago • 3 comments

Summary: The improvement is based on the following ideas:

  • Optimistically assume the input array already contains strings and avoid copying them into a temporary array.
  • Switch to the slower path for the remaining elements, once a non-string is encountered.
  • Use faster access if the input is a dense array.

Apparently this call is used by print(), so it is tested a lot implicitly, for example by the array-push.js test.

Differential Revision: D70415235

tmikov avatar Feb 28 '25 23:02 tmikov

This pull request was exported from Phabricator. Differential Revision: D70415235

facebook-github-bot avatar Feb 28 '25 23:02 facebook-github-bot

This pull request was exported from Phabricator. Differential Revision: D70415235

facebook-github-bot avatar Mar 01 '25 02:03 facebook-github-bot

This pull request was exported from Phabricator. Differential Revision: D70415235

facebook-github-bot avatar Mar 02 '25 04:03 facebook-github-bot