What is best for memory and performance ! I have some data came from fire base through a listener, should i put them on a list of object using for loop then insert the list to the room or make a for loop and looping the (insert to room) !!!
Method 1 :
List<object> list = new List<>.
();
For (int i;i>= list.size; i++){
list.add(data);
}
InsertToRoom(list);
Method 2:
For (int i;i>= list.size; i++){
InsertToRoom(name, age)
}