I am working on a simple GameOfLife program and try out some Optimizations with it. My problem is that when i create the cells for the Game (small class with 6 Primitives) it can take a long time (especially when i create like 10000*10000 ).
So my question is if anyone has an idea how to do that faster?
cells = new Cell[this.collums][this.rows];
for (int x = 0; x < cells.length; x++) {
for (int y = 0; y < cells[0].length; y++) {
cells[x][y] = new Cell(x * this.cellSize, y * this.cellSize, this.cellSize);
}
}
Creating a large amount of objects like this is going to be slow, there are 2 possible workarounds:
The first one is quicker, but the second is more Object Orientated.