What is the fastest way? [closed]

-1

I made a game in Java and the data of the players are in the database, when a player enters, it is placed in a ArrayList<PlayerData> where it contains the getters and setters

asked by anonymous 25.08.2018 / 23:19

2 answers

2

Hard to spike without knowing more information, but it is highly likely that keeping in memory will always be faster under normal conditions. Access to an external device has always been much slower, even if it is an SSD. This may change with non-volatile memories, but we still do not know how much.

But if you're worried about performance you might review other things in the application, maybe eliminating getters and setters , which in many scenarios are unnecessary and cause slowness. There are probably other things in the code that are making it slow and do not even know it.

    
26.08.2018 / 02:29
-1

I think it's much more viable to modify directly in the database and just recover the information, than you use the code to save later, of course if you want to do both you can use a Thread, this would certainly improve the performance of the app , since it would not have to do one at a time, but the two independent of each other.

    
26.08.2018 / 02:58