예, 메모리와 대역폭을 절약 할 수 있습니다 ... 속도 테스트 (이 질문에 완전히 밀접하지 않지만 유용하며 스트림 읽기를 중지 할 것을 제안합니다)와 메모리 테스트 만 수행하면됩니다. 입증해라. 피크 메모리 테스트를 실행하지는 않았지만 최소한 $ html 변수는 정보를 적게 저장하고 메모리를 절약 할 것입니다.
Time to get ALL characters of remote page 10 times: 6.0368211269379
Time to get ALL characters of remote page 10 times: 6.0158920288086
Time to get ALL characters of remote page 10 times: 5.8945140838623
Time to get ALL characters of remote page 10 times: 8.867082118988
Time to get ALL characters of remote page 10 times: 5.7686760425568
Time to get first ten characters of page 10 times: 4.2118229866028
Time to get first ten characters of page 10 times: 4.5816869735718
Time to get first ten characters of page 10 times: 4.2146580219269
Time to get first ten characters of page 10 times: 4.1949119567871
Time to get first ten characters of page 10 times: 4.1788749694824
답변
Memory Useage First 10 characters:40048
Memory Useage ALL characters:101064
하지 , 그러나 당신이 찾을 수있는 흥미로운 : http://stackoverflow.com/questions/555523/file-get-contents-vs-curl-what-has-better - 성능 –
덕분에, 나는 그것이 내가 컬링으로 전환 할 것을 확신했다고 생각한다. –