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

Conversation

Projects
None yet
6 participants
@andresgutierrez
Member

andresgutierrez commented May 18, 2015

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

Merge pull request #958 from phalcon/low-overhead-fcall
Low overhead fcall (only PHP 5.6)

@andresgutierrez andresgutierrez merged commit 2a30184 into master May 18, 2015

3 checks passed

continuous-integration/appveyor AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
continuous-integration/travis-ci/push The Travis CI build passed
Details
@sergeyklay

This comment has been minimized.

Member

sergeyklay commented May 18, 2015

👍

@ovr

This comment has been minimized.

Contributor

ovr commented May 19, 2015

Nice work 👍

@Green-Cat

This comment has been minimized.

Contributor

Green-Cat commented May 19, 2015

👍

@sergeyklay

This comment has been minimized.

Member

sergeyklay commented May 19, 2015

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

@pasmanp

This comment has been minimized.

pasmanp commented May 19, 2015

this only apply to php 5.6.x ?

@nkt

This comment has been minimized.

Contributor

nkt commented Jun 2, 2015

Great! 👍

@nkt

This comment has been minimized.

Contributor

nkt commented Jun 2, 2015

I guess we should update version.

@sergeyklay sergeyklay deleted the low-overhead-fcall branch Mar 23, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment