replace slice option inplace to safe memory
performance tuning