improve performance for ns-frame.sh.