Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Commits on Feb 3, 2010
  1. speed up bind function for Variant

    myang authored
    Summary: The bind function for Variant is frequently called. For instance,
             every rvalAt returns a Variant and therefore involves a call to
             bind(). I did some manual inline to speed up bind especially when
             the type is primitive. For the following test case, the speed up is
             about 12.6%.
             <?php
             function foo($a) {
               for ($i = 0; $i < 10000; $i++) {
                 for ($j = 0; $j < 10000; $j++) {
                   $b = $a[0];
                 }
               }
             }
             $a = array(1, 2, 3);
             foo($a);
             
             time test.old
             
             real    0m3.990s
             user    0m3.948s
             sys     0m0.009s
             time test.new
             
             real    0m3.487s
             user    0m3.447s
             sys     0m0.008s
    
    Reviewed By: hzhao
    
    Test Plan: This change passed fast_tests and slow_tests
               Also made www and browsed the site
    
    Revert: OK
    
    DiffCamp Revision: 87941
    
    git-svn-id: http://svn.facebook.net/hiphop/fbomb/branches/hphp-dev/fbcode/hphp@21199 2248de34-8caa-4a3c-bc55-5e52d9d7b73a
Something went wrong with that request. Please try again.