awk, c, 자바 의 IO 속도 테스트

먼저 c + + 로 얻 은 간단 하지만 방대 한 테스트 파일: 1000 만 줄 의 "A B C D"
createFile. cpp 에서 생 성 된 테스트 파일 은 test. in 입 니 다.
awk 스 크 립 트 read. awk
c 코드 read. c
자바 코드 read. java
테스트 스 크 립 트 testscript. sh
테스트 결과:
test file is creating
test file created
 
now test awk script
line count = 10000000
run time = 4s
awk script test finish
 
now test c programme language
./read
test.in
lines count = 10000000
time cost = 0.870000
c test finish
 
now test Java
test.in
lines count = 10000000
time cost = 16.968s
java test finish
 

좋은 웹페이지 즐겨찾기