- 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
sliceandreduce(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:
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
sliceandreduce(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
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
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
sliceandreduce(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
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: