Replace perl+sed with python in countfreq.sh, performance increased from 1m8s to 43s running-time.But memory usage is very high when huge file is used (>20GB ram + swap).Will be fix later.