posted on Tue, May 27th, 2008
After setting up the D develop environment and compiling the first small programs, I got interested in the mysql performance of D, which basically uses the C library provided by mysql. Therefore I didn't expect to much performance here as PHP uses the same library to connect and query the mysql database. As D is natively compiled there it is slightly faster in the user space.
For the test I used a table with 1.124 million records and selected only the id from the first 100'000 datasets. I run the test 10 times and put the data in the charts below. The database is on the same server as the installation of PHP and D. The PHP version is 5.2.1. For D I used DDBI and Tango.
| Real time comparison |
| D |
5.503 | 5.353 | 5.428 | 5.246 | 5.152 | 5.548 | 4.773 | 5.314 | 5.427 | 4.791 |
| PHP |
4.856 | 4.902 | 4.875 | 5.171 | 5.240 | 5.229 | 5.684 | 5.128 | 5.144 | 4.937 |
| User time comparison |
| D |
0.532 | 0.472 | 0.520 | 0.524 | 0.488 | 0.436 | 0.240 | 0.524 | 0.428 | 0.384 |
| PHP |
1.016 | 1.072 | 1.036 | 1.036 | 1.120 | 1.160 | 1.168 | 1.140 | 1.140 | 1.112 |
| Sys time comparison |
| D |
0.236 | 0.196 | 0.240 | 0.204 | 0.180 | 0.152 | 0.240 | 0.196 | 0.172 | 0.208 |
| PHP |
0.168 | 0.188 | 0.220 | 0.208 | 0.256 | 0.220 | 0.244 | 0.196 | 0.220 | 0.228 |
Leave a Comment
Commenting is not available in this weblog entry.