What's the most efficient way to do a String Builder in JS? [].join() vs. str.substr vs. ? Specifically I want to create a string with holes that I plan to fill later of unknown size, is there a way to do with this typed arrays maybe?
-
-
Replying to @matthewcp1 reply 0 retweets 2 likes
-
Mathias Bynens Retweeted Benedikt Meurer
See https://twitter.com/bmeurer/status/1102452256794906625 …, although there have been some changes in V8 since then. For the holey string use case, a TypedArray doesn’t sound like a bad idea to me (if you’re okay with the overhead of concerting between code points and strings). Can you give more details?
Mathias Bynens added,
2 replies 0 retweets 3 likes
In general though, start with writing code that you think makes sense and is readable. If it’s slower than you’d expect, let us know and file a V8 bug at http://v8.dev/bug !
11:42 AM - 16 Jul 2019
0 replies
0 retweets
3 likes
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.
JavaScript, HTML, CSS, HTTP, performance, security, Bash, Unicode, i18n, macOS.
Wrote down some findings regarding string concatenation performance in JavaScript. Seems like this is still an area that could use some work.