Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Low overhead fcall (only PHP 5.6) #958

Merged
merged 3 commits into from May 18, 2015
Merged

Conversation

andresgutierrez
Copy link
Contributor

This PR introduces a specialized function to call functions in the PHP userland removing many internal intermediate structures. zephir_call_func_aparams_fast is only used when an inline local cache is available for the method. This is when a function is called more than once in the same method or a function is called within a loop.

The following code:

public static function guid()
{
        return sprintf("%04X%04X-%04X-%04X-%04X-%04X%04X%04X", 
            rand(0, 65535), rand(0, 65535), 
            rand(0, 65535), rand(16384, 20479), 
            rand(32768, 49151), rand(0, 65535), 
            rand(0, 65535), rand(0, 65535));
}

Benchmark (executed 1'000.000 times):

v0.6.2 3289 milliseconds
v0.6.3 2149 milliseconds
65% improvement

andresgutierrez added a commit that referenced this pull request May 18, 2015
Low overhead fcall (only PHP 5.6)
@andresgutierrez andresgutierrez merged commit 2a30184 into master May 18, 2015
@sergeyklay
Copy link
Member

👍

@ovr
Copy link
Contributor

ovr commented May 19, 2015

Nice work 👍

@Green-Cat
Copy link
Contributor

👍

@sergeyklay
Copy link
Member

Benchmark for php/hhvm http://3v4l.org/luMgY

@pasmanp
Copy link

pasmanp commented May 19, 2015

this only apply to php 5.6.x ?

@nkt
Copy link
Contributor

nkt commented Jun 2, 2015

Great! 👍

@nkt
Copy link
Contributor

nkt commented Jun 2, 2015

I guess we should update version.

@sergeyklay sergeyklay deleted the low-overhead-fcall branch March 23, 2017 23:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants