improve performance of command line
Merge pull request #938 from afc163/master

improve performance of command line