Skip to main content
Stack Overflow
  1. About
  2. For Teams

Return to Answer

Post Timeline

Active reading [<https://www.youtube.com/watch?v=1Dax90QyXgI&t=17m54s> <https://www.youtube.com/watch?v=1Dax90QyXgI&t=19m05s> <https://en.wikipedia.org/wiki/MacOS> <https://en.wikipedia.org/wiki/MacOS_High_Sierra> <https://en.wikipedia.org/wiki/Google_Chrome>].
Source Link
Peter Mortensen
  • 31.3k
  • 22
  • 110
  • 134

Today (2020年04月24日) I perform tests for chosen solutions for big and small arrays. I tested them on MacOs HighmacOS v10.13.6 (High Sierra 10.13.6) on Chrome 81.0, Safari 13.1, and Firefox 75.0.

  • surprisingly for small arrays, non-in-place solutions based on slice and reduce (D,E,F) are usually 10x-100x faster than in-place solutions
  • for big arrays the in-place-solutions based on splice (AI,BI BI,CI and CI) was fastest (sometimes ~100x - but it depends ofon the array size)
  • for small arrays the BI solution was slowest
  • for big arrays the E solution was slowest

enter image description hereEnter image description here

Tests waswere divided into two groups: in-place solutions (AI,BI BI,CI and CI) and non-in-place solutions (D,E E,F and F) and was performperformed for two cases:

  • test for an array with 10 elements - you can run it HEREhere
  • test for an array with 1.,000.,000 elements - you can run it HEREhere

Tested code is presented in the below snippet:

Example results for a small array on chromeGoogle Chrome are below:

enter image description hereEnter image description here

Today (2020年04月24日) I perform tests for chosen solutions for big and small arrays. I tested them on MacOs High Sierra 10.13.6 on Chrome 81.0, Safari 13.1, Firefox 75.0.

  • surprisingly for small arrays non-in-place solutions based on slice and reduce (D,E,F) are usually 10x-100x faster than in-place solutions
  • for big arrays the in-place-solutions based on splice (AI,BI,CI) was fastest (sometimes ~100x - but it depends of array size)
  • for small arrays BI solution was slowest
  • for big arrays E solution was slowest

enter image description here

Tests was divided into two groups: in-place solutions (AI,BI,CI) and non-in-place solutions (D,E,F) and was perform for two cases

  • test for array with 10 elements - you can run it HERE
  • test for array with 1.000.000 elements - you can run it HERE

Tested code is presented in below snippet

Example results for small array on chrome are below

enter image description here

Today (2020年04月24日) I perform tests for chosen solutions for big and small arrays. I tested them on macOS v10.13.6 (High Sierra) on Chrome 81.0, Safari 13.1, and Firefox 75.0.

  • surprisingly for small arrays, non-in-place solutions based on slice and reduce (D,E,F) are usually 10x-100x faster than in-place solutions
  • for big arrays the in-place-solutions based on splice (AI, BI, and CI) was fastest (sometimes ~100x - but it depends on the array size)
  • for small arrays the BI solution was slowest
  • for big arrays the E solution was slowest

Enter image description here

Tests were divided into two groups: in-place solutions (AI, BI, and CI) and non-in-place solutions (D, E, and F) and was performed for two cases:

  • test for an array with 10 elements - you can run it here
  • test for an array with 1,000,000 elements - you can run it here

Tested code is presented in the below snippet:

Example results for a small array on Google Chrome are below:

Enter image description here

added 12 characters in body
Source Link
Kamil Kiełczewski
  • 93.8k
  • 34
  • 402
  • 375

PerformanceSolutions & Performance

Performance

Solutions & Performance

added 140 characters in body
Source Link
Kamil Kiełczewski
  • 93.8k
  • 34
  • 402
  • 375
Commonmark migration
Source Link
Loading
added 10 characters in body
Source Link
Kamil Kiełczewski
  • 93.8k
  • 34
  • 402
  • 375
Loading
Source Link
Kamil Kiełczewski
  • 93.8k
  • 34
  • 402
  • 375
Loading
lang-js

AltStyle によって変換されたページ (->オリジナル) /