Hi Shubham,
I think your analysis is correct in that the slowdown for large trajectories would be high memory consumption, and the copying of the coordinates into a convenience array exacerbates that.  It make the memory use about triple (original coordinates, convenience copy, smoothed coordinates) while the script runs.  Referring back to the original coordinates instead of copying would reduce memory use to about double, at the cost of having to fetch/convert each coordinate set 5 times (for a smoothing window of 2).  Nonetheless, the tradeoff could be worth it.  I’ve attached a version of the smoothing script that refers to the original coordinates instead of copying, and you could try it out and see if it helps.

--Eric

Eric Pettersen
UCSF Computer Graphics Lab