I remember a discussion about system calls here earlier. What is the status of that?

I've been doing some tests and have found that this code runs about 2.5 times slower under 4.3.2 than it did on 4.1.2 on the same machine (running OS X):

<?php
$filename = 'file.html';
$fd = fopen($filename, 'rb');
$content = fread($fd, filesize($filename));
fclose($fd);
echo $content;
?>

I did some tests with fs_usage to check file system calls and found that for a zero length test.php file, 4.3.2 makes the following additional calls beyond 4.1.2:

1 chdir  /Library/WebServer/Documents/rot/bench
1 fchdir
12 fstat
5 fstatfs
5 getdirentries
7 lseek O=0x00000000
1 lstat test.php
6 lstat (., .., ../.., etc.
6 open  (., .., ../.., etc)
1 stat

The fread example above made the following additional calls in 4.3.2 beyond 4.1.2:

2 chdir /Library/WebServer/Documents/rot/bench
2 fchdir
32 fstat
15 fstatfs
15 getdirentries
16 lseek O=0x00000000
1 lstat  file.html
1 lstat test.php
18 lstat (., .., ../.., etc.)
17 open  (., .., ../.., etc)
4 stat
1 stat .

some of my counts my be slightly off - I counted them by hand.


-- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php



Reply via email to