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?
-
-
I'm parsing a vdom structure and turning it into a string of HTML (a typed array would be fine too). I need to do analysis on the entire thing for optimization, so I need to leave holes. I really need a string#splice equivalent.
-
I can't use a typed array.fill() because the hole will be filled by either 0 or N items (where N is a known value).
End of conversation
New conversation -
-
-
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 !
Thanks. Twitter will use this to make your timeline better. UndoUndo
-
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.