Same here. I've tried 3 different Sieves with lazy and non-lazy versions and they all time out. Python test cases accept the most straightforward and non-optimized algorithm
I was looking for a one liner. This I like, but I think we could even optimize further, if we just fill the vector with zeros (up to arr.len()), instead of a second iteration.
Ok, I gave forfait (in Rust) and I have no idea on how one earth I wasn't able to meet the perf criteria, even if using Miller's method, and I was able to be n times faster generating primes than the commond sieve... I need some explanation :<
Same here. I've tried 3 different Sieves with lazy and non-lazy versions and they all time out. Python test cases accept the most straightforward and non-optimized algorithm
I guess, rust tests cases are not fair
I was looking for a one liner. This I like, but I think we could even optimize further, if we just fill the vector with zeros (up to arr.len()), instead of a second iteration.
Ok, I gave forfait (in Rust) and I have no idea on how one earth I wasn't able to meet the perf criteria, even if using Miller's method, and I was able to be n times faster generating primes than the commond sieve... I need some explanation :<