KrazyGlue
Smash Champion
I have a question regarding which language I should be running my code in to make it run faster (it's currently in Java). It's kind of confidential, but I'll explain in basic terms what it does.
It takes an integer input from the user (we'll call it x). It then makes a two-dimensional boolean array with x amount of rows and columns. Each possible combination of trues and falses in the array is then generated, and each time a new combination is generated, the program checks for a certain pattern of trues and falses.
Unfortunately, the code has to check two to the x-squared amount of combinations. For example, if x=5, the code has to check 2^25 combinations, or about 33.5 million. If x=6, it has to check 2^36 combinations, or 6.8 billion. If x=7, it has to check 562 trillion times. I don't want to go into specifics, but it also has to check each combination of the boolean array many different times in order to see if it can find the patterns of trues/falses it is looking for. As you can see, it takes TONS of time.
Thankfully, we only have to check half of those boolean array combinations because the second half of them are just the exact opposite of the first half. We've also multithreaded it to allow the program to use all of the computer's cores (with the discretion of the user). Still, we'd like to make it a lot faster.
Right now the program is in java. A friend of mine recommended using an assembly language. Should I use Java, an assembly language, or something else?
Thanks in advance for your help and sorry in advance for the cryptic OP.
It takes an integer input from the user (we'll call it x). It then makes a two-dimensional boolean array with x amount of rows and columns. Each possible combination of trues and falses in the array is then generated, and each time a new combination is generated, the program checks for a certain pattern of trues and falses.
Unfortunately, the code has to check two to the x-squared amount of combinations. For example, if x=5, the code has to check 2^25 combinations, or about 33.5 million. If x=6, it has to check 2^36 combinations, or 6.8 billion. If x=7, it has to check 562 trillion times. I don't want to go into specifics, but it also has to check each combination of the boolean array many different times in order to see if it can find the patterns of trues/falses it is looking for. As you can see, it takes TONS of time.
Thankfully, we only have to check half of those boolean array combinations because the second half of them are just the exact opposite of the first half. We've also multithreaded it to allow the program to use all of the computer's cores (with the discretion of the user). Still, we'd like to make it a lot faster.
Right now the program is in java. A friend of mine recommended using an assembly language. Should I use Java, an assembly language, or something else?
Thanks in advance for your help and sorry in advance for the cryptic OP.