update MemSamPe.scala (performance tuning)