Last active
March 24, 2023 22:04
-
-
Save DoctorDerek/cc97857f16f435102501b97b9253a0d2 to your computer and use it in GitHub Desktop.
JSBench.me test cases: https://jsbench.me/qmkm3wp74g/1 Read the article on Medium: https://medium.com/p/1a8365dfc363 Chrome Version 88.0.4324.190 (Official Build) (64-bit) Spreadsheet https://docs.google.com/spreadsheets/d/1Csy-hPQnmExg3RyfHtbl4lEhr5kce3i3TS5Rv1oncr0/edit#gid=0 Chart at Vimse https://my.visme.co/view/768q3ww7-should-you-use-incl…
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Array size: | 10 items | 1,000 items | 100,000 items | 1,000,000 items | |
---|---|---|---|---|---|
.includes() | Fastest | Fastest | 47.07% slower | 46.77% slower | |
.filter() | 97.16% slower | 99.99% slower | 97.69% slower | 97.66% slower | |
.some() | 84.81% slower | 99.98% slower | 95.11% slower | 95.01% slower | |
for loop | 84.2% slower | 99.62% slower | Fastest | Fastest | |
.find() | 85.74% slower | 99.98% slower | 95.19% slower | 95.06% slower |
Chrome Version 88.0.4324.190 (Official Build) (64-bit), Windows 10
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
JSBench.me test cases: https://jsbench.me/qmkm3wp74g/1
Read the article on Medium: https://medium.com/p/1a8365dfc363