ID: 38630 User updated by: dobes at lnx dot cz Reported By: dobes at lnx dot cz Status: Bogus Bug Type: Performance problem Operating System: winXP PHP Version: 5.1.5 New Comment:
Yes, I agree, it have to be slower, but why 3 times? I change calling $this->x = $this->g(); to direct calling $this->x = mt_rand( $this->l, $this->h ); and it improve runtime from 0m6.060s to 0m4.538s ... it is too big difference when I change only one calling of protected class function to the PHP internal. I wrote this bug because I beleve in better performace of classes in next PHP versions. Previous Comments: ------------------------------------------------------------------------ [2006-08-28 16:24:58] [EMAIL PROTECTED] You are benchmarking totally different things. <?php function foo() { bar(); } foo(); ?> is always slower than <?php bar(); ?> in this universe. ------------------------------------------------------------------------ [2006-08-28 16:06:37] dobes at lnx dot cz Description: ------------ I checked small benchmark described on http://destiney.com/benchmarks/db_insert_select (wrote when PHP5.0.3 was current) and I get quite similar result ;-( But I checked PHP5.1.6 (this is not in your PHP version list). I think bad perbormance of OOP code is bug and not feature. Reproduce code: --------------- look on http://destiney.com/benchmarks/db_insert_select, it's longer than 20 lines. Expected result: ---------------- Just shorter run-time of OOP code. Actual result: -------------- Runtime of OOP scriot is still 3x longer than proc code (the same as in PHP5.0.3). ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=38630&edit=1