Quantcast
Channel: Helloworld922's Blog
Viewing all articles
Browse latest Browse all 25

More Fun with Sieving Primes

$
0
0

I was playing around with my prime sieving implementation and I managed to improve the performance by making some simple changes. The code looks quite a bit different, but functionally it does basically the same thing. The one big difference is that I switched the code to use arrays instead of ArrayLists. Through some testing I realized that there was a fairly significant performance difference between arrays and ArrayLists. The actual problem has to deal with Java generics and boxing of primitives. I may go more into the details at a later date. It's a rather specialized optimization and for the vast majority of programs shouldn't be necessary. Other than that, the code is generally more readable.

Read more »

Viewing all articles
Browse latest Browse all 25

Trending Articles