Skip to content

Conversation

veksa
Copy link

@veksa veksa commented Dec 4, 2023

Based on the benchmark (https://jsben.ch/kxBxv), the "for in" loop appears to be 10% slower than the "for" loop.

This pull request optimizes object traversal loops.
Also ESLint errors fixed.

@robinweser
Copy link
Owner

Screenshot 2023-12-04 at 13 00 03

I get some very different results, so I'm rather hesitant to change any of those right now.

@veksa
Copy link
Author

veksa commented Dec 4, 2023

i created a benchmark on another platform, https://jsbench.me/a4lpr3txxo/1
also tested it on Win11 and Mac.
could you please check it

@robinweser
Copy link
Owner

I get the same results over there. I think it's more about browser differences than the actual benchmark. I use Safari, most likely different in Firefox and/or Chrome.

@veksa
Copy link
Author

veksa commented Dec 5, 2023

yeah, checked it on M1 in Safari. It seems faster, will investigate further into this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants