I am trying to write program about sensor calculator and I would like to hear from you guys how can I improve execution time of my program?
In brief a sensor calculator is program that performs matrix multiplication. It could receive 50,000 matrices per second. Sensor calculator primary job is to receive matrices and calculate them with one of the 5 matrices that are already stored in program.
Sensor calculator has 5 methods and every method has own matrix which it multiplies with received(parameter) matrix(Matrix multiplication). And of course they return produced matrix.
- I have totally 50 000 virtual censors in various computers.
- Every sensor is sending every second one matrix to calculator(server) with UDP.
- Server which hosts sensor calculator, receive matrix and calculate it.
- Server will send back result to sensor(client) with UDP.
All matrices are 10x10 size.
For example the first method is:
public int[10][10] calculateWind(int[10][10] A){
int[10][10] C = new int[10][10]; //
for (int i = 0; i < 10; i++) { // Row
for (int j = 0; j < 10; j++) { // Column
for (int k = 0; k < 10; k++) { // Column
C[i][j] += A[i][k] * B[k][j];//B is constant matrix(private attribute)
}
}
}
return C;}
I am using Java but someone told me that I could use FORTRAN & C with java and that could help?
I am trying to find the fastest way. Tell me guys everything what you think that could help my program improve it's performance. Changing programming language? Using unique algorithm?
Every advice is welcome except using ASSEMBLY and thanks for your advice.