JavaScript Array.push is 945x faster than Array.concat

JavaScript Array.push is 945x faster than Array.concat

It didn’t take long for me to set up timers to narrow down out which part of the code was causing the slowdown, but I was pretty surprised when I found the culprit:

In order to allow tests to be written using simple commands like instead of CSS or XPATH selectors , UI-licious works using dynamic code analysis to analyse the DOM tree to determine what and how to test your website based on semantics, accessibility attributes, and popular but non-standard patterns. Several in fact, plus a comparison with lodash’s :

👉 Link to the test on JsPerf

Let’s talk about the first set of naive implementation:

As you can see, the only difference between the two is that the implementation modifies the first array directly. Under the hood, the UI-licious test engine scans the DOM tree of the target application, evaluating the semantics, accessible attributes and other common patterns to determine what is the target element and how to test it.

Source: dev.to