summaryrefslogtreecommitdiff
path: root/ext/pgsql/php_pgsql.h
diff options
context:
space:
mode:
authorAnton Blanchard <anton@samba.org>2015-05-26 23:06:12 +1000
committerRemi Collet <remi@php.net>2015-07-28 18:38:23 +0200
commit4d578f28df214c5faf115d3a629f9ffe82640b2b (patch)
tree7d7420343987c5785e88c7777806e93ede0e2023 /ext/pgsql/php_pgsql.h
parent305199a13163e246b909ef32880df032823bff05 (diff)
downloadphp-git-4d578f28df214c5faf115d3a629f9ffe82640b2b.tar.gz
Improve performance of PowerPC64 fast_long_increment_function
Detecting overflow with the XER is slow, partially because we have to clear it before use. gcc does a better job of detecting overflow of an increment or decrement than we can with inline assembly. It knows that an increment will only overflow if it is one less than the overflow value. This means we end up with a simple compare/branch. Furthermore, leaving it in c allows gcc to schedule the instructions better. This is 6% faster on a POWER8 running a simple testcase: <?php function testcase($count = 100000000) { $x = 1; for ($i = 0; $i < $count; $i++) { $x++; $x++; $x++; $x++; $x++; } } testcase(); ?>
Diffstat (limited to 'ext/pgsql/php_pgsql.h')
0 files changed, 0 insertions, 0 deletions