Req #71932 [NEW]: Low performance with bit operation

From: Date: Thu, 31 Mar 2016 10:59:49 +0000
Subject: Req #71932 [NEW]: Low performance with bit operation
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-200256@lists.php.net to get a copy of this message
From: jacky at xsteach dot com Operating system: Mac OS X 10.11 PHP version: Irrelevant Package: Performance problem Bug Type: Feature/Change Request Bug description:Low performance with bit operation Description: ------------ Bit operation on php 5.6+ is lower performance than php 5.5-. php5.5 is faster 3x+ than php5.6 and php7.0. $ php5 -v PHP 5.5.31 (cli) (built: Feb 20 2016 20:33:10) Copyright (c) 1997-2015 The PHP Group Zend Engine v2.5.0, Copyright (c) 1998-2015 Zend Technologies $php5 demo.php Done in 0.047697067260742 seconds $ php -v PHP 5.6.19 (cli) (built: Mar 6 2016 14:18:03) Copyright (c) 1997-2016 The PHP Group Zend Engine v2.6.0, Copyright (c) 1998-2016 Zend Technologies with Xdebug v2.4.0, Copyright (c) 2002-2016, by Derick Retinas $ php demo.php Done in 0.15873312950134 seconds $ php7 -v PHP 7.0.4 (cli) (built: Mar 6 2016 14:30:59) ( NTS ) Copyright (c) 1997-2016 The PHP Group Zend Engine v3.0.0, Copyright (c) 1998-2016 Zend Technologies with Zend OPcache v7.0.6-dev, Copyright (c) 1999-2016, by Zend Technologies with Xdebug v2.4.0RC4-dev, Copyright (c) 2002-2015, by Derick Rethans $ php7 demo.php Done in 0.10964512825012 seconds Test script: --------------- <?php function microtime_float() { list($usec, $sec) = explode(" ", microtime()); return ((float)$usec + (float)$sec); } $time_start = microtime_float(); $i = 1920 * 1080; $a = 1; while ($i--) { $a << 1; } $time_end = microtime_float(); $time = $time_end - $time_start; echo "Done in $time seconds\n"; Expected result: ---------------- Bit operation on php7.0 as faster as php5.5 or even better. Actual result: -------------- Low performance with bit operation on php7.0. -- Edit bug report at https://bugs.php.net/bug.php?id=71932&edit=1 -- Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=71932&r=trysnapshot54 Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=71932&r=trysnapshot55 Try a snapshot (trunk): https://bugs.php.net/fix.php?id=71932&r=trysnapshottrunk Fixed in SVN: https://bugs.php.net/fix.php?id=71932&r=fixed Fixed in release: https://bugs.php.net/fix.php?id=71932&r=alreadyfixed Need backtrace: https://bugs.php.net/fix.php?id=71932&r=needtrace Need Reproduce Script: https://bugs.php.net/fix.php?id=71932&r=needscript Try newer version: https://bugs.php.net/fix.php?id=71932&r=oldversion Not developer issue: https://bugs.php.net/fix.php?id=71932&r=support Expected behavior: https://bugs.php.net/fix.php?id=71932&r=notwrong Not enough info: https://bugs.php.net/fix.php?id=71932&r=notenoughinfo Submitted twice: https://bugs.php.net/fix.php?id=71932&r=submittedtwice register_globals: https://bugs.php.net/fix.php?id=71932&r=globals PHP 4 support discontinued: https://bugs.php.net/fix.php?id=71932&r=php4 Daylight Savings: https://bugs.php.net/fix.php?id=71932&r=dst IIS Stability: https://bugs.php.net/fix.php?id=71932&r=isapi Install GNU Sed: https://bugs.php.net/fix.php?id=71932&r=gnused Floating point limitations: https://bugs.php.net/fix.php?id=71932&r=float No Zend Extensions: https://bugs.php.net/fix.php?id=71932&r=nozend MySQL Configuration Error: https://bugs.php.net/fix.php?id=71932&r=mysqlcfg

« previous php.bugs (#200256) next »