Benchmarking 4.3.2 vs 4.1.2
| From: | Jeff Moore | Date: | Wed, 04 Jun 2003 16:01:44 +0000 |
| Subject: | Benchmarking 4.3.2 vs 4.1.2 | ||
| Groups: | php.internals | ||
| Request: | Send a blank email to internals+get-2160@lists.php.net to get a copy of this message | ||
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.