Evaluating two different Algorithms, which one will scale better?

I'm evaluating two different algorithms to choose one for my implementation, they just do calculations on top of arrays, get some input of $$n$$ elements, and produce some output of $$m$$ elements, and I'm looking for an opinion about which one will scale better.

The output they provide given the input is exactly the same on both cases, the computation time for the second is slightly better, maybe a 20%...

As I have the code from both, I have been able to get some counts out of the main loop, where the processing happens (they are iterative).

The first Algorithm behavior reminds me a lot merge sort, for a input $$n$$, every iteration just process half of the elements, so for $$n=4000$$ each iteration process half of the elements until there is no more $$i_1=2000,i_2=1000,i_3=500,...,i_x=1$$

The second Algorithm is just linear, I did the same count thing, and with input $$n=4000$$, looks like it just process $$\approx n/c$$ (some $$c$$) elements per iteration, so $$i_1=266,i_2=266,i_3=266,...,i_x=266$$

(They do not depend on the numerical values in the input)

Which one will you choose?

• If you want us to compare the algorithm explain them. Here are we talking up to 4000? – kelalaka Oct 12 '18 at 21:15
• Hi @kelalaka that is the test I run to get the info, but could be up to 16M elements in a single array – John Seppard Oct 12 '18 at 23:57
• I improved just a bit the question as well – John Seppard Oct 12 '18 at 23:59
• @JohnSeppard, it looks like you are asking people to help you make a choice based on the incomplete information you provided. Can you post the algorithm as well as some typical input somewhere such as pastbin.com? – Apass.Jack Oct 13 '18 at 1:05
• Do you have any difficulty posting your algorithms and some typical data? The best way for people to decide for you is letting them have as much information as you have. For me, I would like to take a look at the algorithms at least. The distribution pattern of the data is important, too. Knowing what is happening at $n=4000$ is not enough to predict how they will behave at 10 million. – Apass.Jack Oct 13 '18 at 1:24