βItβs only work if somebody makes you do it.β β’ craft code β’ creative ideas β’ cutting edge β’ author β’ senior front end architect β’ professional scuba diver β’ adventures above and below the sea level
Location
Germany
Work
Senior Front End Architect, Full Stack Engineer, Creative Technologist and Scuba Diving Professional
Thank you for your contribution. The "which" is a copy paste error :D
If you have any performance improvements, please share them and I'll happily adjust the code and the article.
βItβs only work if somebody makes you do it.β β’ craft code β’ creative ideas β’ cutting edge β’ author β’ senior front end architect β’ professional scuba diver β’ adventures above and below the sea level
Location
Germany
Work
Senior Front End Architect, Full Stack Engineer, Creative Technologist and Scuba Diving Professional
βItβs only work if somebody makes you do it.β β’ craft code β’ creative ideas β’ cutting edge β’ author β’ senior front end architect β’ professional scuba diver β’ adventures above and below the sea level
Location
Germany
Work
Senior Front End Architect, Full Stack Engineer, Creative Technologist and Scuba Diving Professional
Not looked for faster methods yet, but the current one seems overly verbose. Also, what is
which
for?Thank you for your contribution. The "which" is a copy paste error :D
If you have any performance improvements, please share them and I'll happily adjust the code and the article.
Cheers,
Martin
Binary filters are even faster than the modulo:
Hi Alex,
I checked the performance on hasty and indeed much faster. I updated the code and the article.
Thank you!
Faster still if you omit the unnecesary
=== 1
- it's about even on Firefox, but consistently quicker on Chrome (10-15%) - linkMuch faster again (on all tested browsers):
Hi Jon Randy,
I updated the benchmark on hasty - impressive improvement!
I updated the code and the article.
Thank you for the improved code.
Cheers!
Thank you!
You might want to make the benchmark call the functions as well as define them! :P
wouldn't jumping 2 steps ensure only odd positional, but not values?
(I just assume an unsorted array of random values)
Odd positional is what we're after
If you are already using a for loop, you can also jump 2 steps on every iteration:
Haha... yeah - oops