I am trying to optimize some code for memory consumption. In my code I receive a list of datapoints, perform an action that changes each datapoint, and then save it to a list.