php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #62529 Static Methods are Slower than Object Defined Methods
Submitted: 2012-07-11 09:10 UTC Modified: 2012-07-11 13:02 UTC
Votes:1
Avg. Score:3.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:0 (0.0%)
Same OS:0 (0.0%)
From: mahan dot mp at live dot com Assigned: johannes (profile)
Status: Closed Package: Performance problem
PHP Version: 5.3.15RC1 OS: Windows
Private report: No CVE-ID: None
 [2012-07-11 09:10 UTC] mahan dot mp at live dot com
Description:
------------
Static methods are slower than Object Defined methods

Test script:
---------------
http://www.vanylla.it/tests/static-method-vs-object.php


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2012-07-11 13:02 UTC] johannes@php.net
Thank you for your bug report. This issue has already been fixed
in the latest released version of PHP, which you can download at 
http://www.php.net/downloads.php

There were many optimizations in 5.4 which help there. On my system I got 

Static call time: 0.053794145584106 ms
Object method call time: 0.063946008682251 ms
Static call (when the static is in the same class of object method) time: 0.063071966171265 ms

In general I would say that more people use dynamic calls so optimizations there are more relevant to overall performance.
 [2012-07-11 13:02 UTC] johannes@php.net
-Status: Open +Status: Closed -Assigned To: +Assigned To: johannes
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Apr 20 01:01:28 2024 UTC