DreadHeadedDeveloper
DreadHeadedDeveloper

Reputation: 620

Initializing variables and efficiency

I am in the middle of developing a highly memory intensive program that will pretty much be focusing and iterating one method several million times. As a result, I want to make it as efficient as possible. So, I switched out algorithms for more efficient ones, made sure there were no unnecessary/one-shot variables, etc. Basically, I've done everything I know how to do and it's still not enough.

Here's my question.

int tracker1 = 8, tracker2 = 18, tracker3 = 123,....; //ex 1

int tracker1 = 8;
int tracker2 = 18;
int tracker3 = 123;
//.... ex 2

Is there any difference between the 2? I know it may sound stupid, but understand, we are dealing with a couple million iterations here, so any little bit helps. I am currently testing a few situations right now, but compiling this thing is a nightmare, and so far, I see no changes in memory usage yet. Any help someone could give in the meantime would be nice. It would make things quicker if anyone in the SO community knew off the top of their head because google was not quite helpful nor were my buddies...

Upvotes: 0

Views: 38

Answers (1)

Elliott Frisch
Elliott Frisch

Reputation: 201399

No. There is no difference between the two at a byte code level.

Upvotes: 2

Related Questions