Test para pregunta 322698 en esso-1

JavaScript performance comparison

Test case created by alvaromontoro

Preparation code


      
      <script>
Benchmark.prototype.setup = function() {
  let a1 = ["a","b","c","d","e","f","g","h","i"];
  let a2 = ["a","c","e","g","i","k","m","o","q"];

};
</script>

Test runner

Warning! For accurate results, please disable Firebug before running the tests. (Why?)

Java applet disabled.

Testing in CCBot 2.0.0 / Other 0.0.0
Test Ops/sec
some includes
const a3 = a1.filter(a => a2.some(b => b.includes(a))).sort();
pending…
join includes
const a3 = a1.filter(x=> a2.join(' ').includes(x)).sort();
pending…
join includes (join previo)
const cadena = a2.join(' ');
const a3 = a1.filter(x=> cadena.includes(x)).sort();
pending…

Revisions

You can edit these tests or add even more tests to this page by appending /edit to the URL.

0 Comments