If you have an oldList (an ArrayList) with 10,000 items and you modify the property of the item at index 500, to update it, you can either create a deep copy using val newList = ArrayList(oldList) or currentList.toMutableList(). However, this would create a completely new list with 10,000 items, and each item would be stored in memory. As the number of items in the list increases, the cost of copying for updates will also increase, even though the time complexity is O(n).
In such a scenario, would it not be more performant to use methods like notifyItemChanged(), notifyItemInserted(), notifyItemRemoved(), etc., instead of creating new lists for each update, especially when dealing with a large number of items(such as over 10000 items)?
This feels like sacrificing performance for the sake of convenience for me.