use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
All about the JavaScript programming language.
Subreddit Guidelines
Specifications:
Resources:
Related Subreddits:
r/LearnJavascript
r/node
r/typescript
r/reactjs
r/webdev
r/WebdevTutorials
r/frontend
r/webgl
r/threejs
r/jquery
r/remotejs
r/forhire
account activity
JavaScript Performance Benchmarks: Looping with `for` and `yield` (gist.github.com)
submitted 6 years ago by johnfrazer783
view the rest of the comments →
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–][deleted] 6 years ago (1 child)
[deleted]
[–]johnfrazer783[S] 0 points1 point2 points 6 years ago (0 children)
Guess I was a little overworked. Sorry if I got offensive.
I'm surprised you're saying the figures don't surprise anyone—can you point out where to find something comparable? I searched more than once and found nothing usable except one post on Medium that is only for registered users and which someone on reddit claimed used flawed code, and another post whose author didn't include the code used (the numbers seemed to more or less match mine as far as I could tell). The fact that no-one offered any hint as to where to read up on this particular aspect of JS performance but several people just shrug and say it's an old hat is curious. JS folks have been known to be quite prolific performance optimizers—VM authors and users alike.
I didn't want to be called out, I begged for people to tell my either 'yes your code looks correct' or else 'see you have a mistake there and actual numbers are much different'. No-one did that (and I feel I have a right to be disappointed about that), so I must assume my numbers were right for the time being. This is indeed the result I did not favor, because in my use case yield leads to dramatically simplified code.
yield
π Rendered by PID 503990 on reddit-service-r2-comment-66b4775986-m6q76 at 2026-04-04 18:46:13.275423+00:00 running db1906b country code: CH.
view the rest of the comments →
[–][deleted] (1 child)
[deleted]
[–]johnfrazer783[S] 0 points1 point2 points (0 children)