# What's more efficient?

**URL:** <https://forum.freecodecamp.org/t/whats-more-efficient/440785>\
**Category:** Curriculum Help\
**Tags:** javascript\
**Created:** [January 15, 2021, 1:21pm UTC](https://forum.freecodecamp.org/t/whats-more-efficient/440785 "2021-01-15T13:21:47Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![JeremyLT](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/jeremylt/32/291894_2.png) [@JeremyLT](https://forum.freecodecamp.org/u/JeremyLT)\
**Post date:** [January 15, 2021, 3:22pm UTC](https://forum.freecodecamp.org/t/whats-more-efficient/440785/4 "2021-01-15T15:22:16Z")

</div>

It’s more efficient to only loop once through your data. You can make your array only represent odd numbers and get a nice speedup.

I’ve got some code and discussion here

> [@JavaScript Performance Measurement & Variability](https://forum.freecodecamp.org/t/javascript-performance-measurement-variability/394059):
>
> So, I have a couple of questions about performance in JavaScript. I do high performance C/C++/CUDA professionally, so I’m trying to see what of that knowledge is applicable to JavaScript. In another thread I played with some performance optimization for the Sum Primes challenge. I mostly used C style optimizations, but I think that my performance is reasonable. 
> 
> > **repl link**
> >
> > \<a href="https://replit.com/@jeremylt/ShamefulKnownScans-1"\>https://replit.com/@jeremylt/ShamefulKnownScans-1…

---

_[View the full topic](https://forum.freecodecamp.org/t/whats-more-efficient/440785)._
