perbandingan waktu execution dengan php dan C
Iseng2 mau bandingin execution time dr file i/o menggunakan php dan C, sangat terlihat perdaan yang jauh sekali. Menggunakan C execution timenya 0.001s dan menggunakan PHP execution timenya 0.047s. (s = second = detik)
Dengan C:
[firman@muse ch]$ time ./test #!/bin/ch #include <stdio.h>int main(void) { printf("hello world\n"); return 0; }real 0m0.001s user 0m0.000s sys 0m0.001s
Source:
int main(void) {
printf(”%s\n”, file_get_contents(”a”) );
return 0;
}
Perhatian! file_get_contents() bukan fungsi standard ANSI C!
Dengan PHP:
[firman@muse ch]$ time php test.php #!/bin/ch #include <stdio.h>int main(void) { printf("hello world\n"); return 0; }real 0m0.047s user 0m0.031s sys 0m0.016s
Source:
<?php echo file_get_contents(”a”).”\n”; ?>


