Req #70497 [NEW]: Unnecessary HANDLE_BLOCK_INTERRUPTIONS leads to slowdown

From: Date: Tue, 15 Sep 2015 04:01:16 +0000
Subject: Req #70497 [NEW]: Unnecessary HANDLE_BLOCK_INTERRUPTIONS leads to slowdown
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-196006@lists.php.net to get a copy of this message
From:             dja at axtens dot net
Operating system: All
PHP version:      5.6Git-2015-09-15 (Git)
Package:          Performance problem
Bug Type:         Feature/Change Request
Bug description:Unnecessary HANDLE_BLOCK_INTERRUPTIONS leads to slowdown

Description:
------------
Currently, HANDLE_BLOCK_INTERRUPTIONS and HANDLE_UNBLOCK_INTERRUPTIONS
are used  either for ZEND_SIGNAL support, or to call out to the zend
utility functions struct to call a SAPI-specific function.

However, the only SAPIs that populates those functions in the utility
struct are the obsolete Apache 1 SAPIs: in all other cases the function
pointer is NULL. As such, when ZEND_SIGNAL is off, we can actually
remove the conditional branch entirely.
    
This leads to a speed up on PHP5 code. I've measured the performance
impact on a PowerPC 64-bit little-endian system and on a x86_64 laptop
using the test script below.    

I see a ~6% improvement in performance on POWER and a ~4% improvement
on x86_64.
    
I also see an improvement in a e-commerce web application on POWER
with this change.

I've submitted this change as a pull request on GitHub.

Test script:
---------------
    <?php
    for ($i=1; $i < 100000000; $i++) {
            $genericObject = new stdClass();
            $a = (object) 8;
            $b = (object) 'abcde';
    }
    ?>


-- 
Edit bug report at https://bugs.php.net/bug.php?id=70497&edit=1
-- 
Try a snapshot (PHP 5.4):   https://bugs.php.net/fix.php?id=70497&r=trysnapshot54
Try a snapshot (PHP 5.5):   https://bugs.php.net/fix.php?id=70497&r=trysnapshot55
Try a snapshot (trunk):     https://bugs.php.net/fix.php?id=70497&r=trysnapshottrunk
Fixed in SVN:               https://bugs.php.net/fix.php?id=70497&r=fixed
Fixed in release:           https://bugs.php.net/fix.php?id=70497&r=alreadyfixed
Need backtrace:             https://bugs.php.net/fix.php?id=70497&r=needtrace
Need Reproduce Script:      https://bugs.php.net/fix.php?id=70497&r=needscript
Try newer version:          https://bugs.php.net/fix.php?id=70497&r=oldversion
Not developer issue:        https://bugs.php.net/fix.php?id=70497&r=support
Expected behavior:          https://bugs.php.net/fix.php?id=70497&r=notwrong
Not enough info:            https://bugs.php.net/fix.php?id=70497&r=notenoughinfo
Submitted twice:            https://bugs.php.net/fix.php?id=70497&r=submittedtwice
register_globals:           https://bugs.php.net/fix.php?id=70497&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=70497&r=php4
Daylight Savings:           https://bugs.php.net/fix.php?id=70497&r=dst
IIS Stability:              https://bugs.php.net/fix.php?id=70497&r=isapi
Install GNU Sed:            https://bugs.php.net/fix.php?id=70497&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=70497&r=float
No Zend Extensions:         https://bugs.php.net/fix.php?id=70497&r=nozend
MySQL Configuration Error:  https://bugs.php.net/fix.php?id=70497&r=mysqlcfg



Thread (2 messages)

« previous php.bugs (#196006) next »