Skip to content

improve object iteration#30

Open
veksa wants to merge 1 commit into
robinweser:masterfrom
veksa:improve-object-iteration
Open

improve object iteration#30
veksa wants to merge 1 commit into
robinweser:masterfrom
veksa:improve-object-iteration

Conversation

@veksa

@veksa veksa commented Dec 4, 2023

Copy link
Copy Markdown

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
Copy Markdown
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

veksa commented Dec 4, 2023

Copy link
Copy Markdown
Author

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
Copy Markdown
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

veksa commented Dec 5, 2023

Copy link
Copy Markdown
Author

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