Skip to content

Slow operations +,-,*,/ #26

Closed
Closed

Description

@kormichu

I noticed that the operations such as: +,-,*,/ are slower than in native php. For example, this code:


is 2x faster in php:

native PHP:

real       0m22.390s
user       0m13.020s
sys        0m0.270s

compiled:

real       0m42.287s
user       0m0.020s
sys        0m0.040s

But, the same code without this line:

$o += $x * $y * $z;
has better time for compiled code:

native php:

real       0m10.238s
user       0m9.320s
sys        0m0.170s

compiled:

real       0m6.433s
user       0m0.010s
sys        0m0.000s

Activity

  1. scottmac commented on Feb 23, 2010

    @scottmac
    Contributor

    I enabled compiler optimizations today,

    native php
    real 0m18.184s
    user 0m18.050s
    sys 0m0.030s

    HipHop:
    real 0m12.211s
    user 0m12.120s
    sys 0m0.050`

  2. kormichu commented on Feb 28, 2010

    @kormichu
    Author

    Great! My result:

    native php

    real    0m20.758s
    user    0m5.330s
    sys 0m0.320
    

    HipHop:

    real    0m14.434s
    user    0m0.790s
    sys 0m0.010s
    
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions