diff --git a/.github/workflows/push.yml b/.github/workflows/push.yml index 51751c1fc52d..605fe892b04a 100644 --- a/.github/workflows/push.yml +++ b/.github/workflows/push.yml @@ -43,6 +43,7 @@ env: CXX: ccache g++ jobs: LINUX_X64: + if: false services: mysql: image: mysql:8 @@ -135,6 +136,7 @@ jobs: if: ${{ !matrix.asan }} uses: ./.github/actions/verify-generated-files MACOS_DEBUG_NTS: + if: false runs-on: macos-12 steps: - name: git checkout @@ -168,6 +170,7 @@ jobs: - name: Verify generated files are up to date uses: ./.github/actions/verify-generated-files WINDOWS: + if: false name: WINDOWS_X64_ZTS runs-on: windows-2019 env: @@ -264,6 +267,44 @@ jobs: path: benchmark/repos/data - name: Benchmark run: php benchmark/benchmark.php true + - name: Benchmark 2 + run: php benchmark/benchmark.php true + - name: Benchmark 3 + run: php benchmark/benchmark.php true + - name: Benchmark 4 + run: php benchmark/benchmark.php true + - name: Benchmark 5 + run: php benchmark/benchmark.php true + - name: Benchmark 6 + run: php benchmark/benchmark.php true + - name: Benchmark 7 + run: php benchmark/benchmark.php true + - name: Benchmark 8 + run: php benchmark/benchmark.php true + - name: Benchmark 9 + run: php benchmark/benchmark.php true + - name: Benchmark 10 + run: php benchmark/benchmark.php true + - name: Benchmark 11 + run: php benchmark/benchmark.php true + - name: Benchmark 12 + run: php benchmark/benchmark.php true + - name: Benchmark 13 + run: php benchmark/benchmark.php true + - name: Benchmark 14 + run: php benchmark/benchmark.php true + - name: Benchmark 15 + run: php benchmark/benchmark.php true + - name: Benchmark 16 + run: php benchmark/benchmark.php true + - name: Benchmark 17 + run: php benchmark/benchmark.php true + - name: Benchmark 18 + run: php benchmark/benchmark.php true + - name: Benchmark 19 + run: php benchmark/benchmark.php true + - name: Benchmark 20 + run: php benchmark/benchmark.php true - name: Store result if: github.event_name == 'push' run: | diff --git a/Zend/zend_alloc.c b/Zend/zend_alloc.c index 875c736413ee..81077c50698d 100644 --- a/Zend/zend_alloc.c +++ b/Zend/zend_alloc.c @@ -3168,3 +3168,70 @@ size_t zend_mm_globals_size(void) return sizeof(zend_alloc_globals); } #endif + +#ifdef HAVE_VALGRIND +# if defined(__GNUC__) && !defined(__clang__) +# pragma GCC push_options +# pragma GCC optimize ("-fno-tree-loop-distribute-patterns") +# pragma GCC diagnostic ignored "-Wattributes" +# endif + +/* Use custom memory copying implementations to avoid SSE when profiling. Depending on the memory + * alignment SSE can or cannot be effectively used, which leads to random noise in the profiling + * output. */ + +void *memcpy(void *restrict dest, const void *restrict src, size_t n) +{ + const char *csrc = src; + char *cdest = dest; + for (int i = 0; i < n; i++) { + cdest[i] = csrc[i]; + } + return dest; +} +void *memmove(void *dest, const void *src, size_t n) +{ + char *csrc = (char *)src; + char *cdest = (char *)dest; + + if (cdest < csrc) { + while (n-- != 0) { + *cdest++ = *csrc++; + } + } else { + while (n-- != 0) { + cdest[n] = csrc[n]; + } + } + return dest; +} +void *memset(void *s, int c, size_t n) +{ + unsigned char *cs = (unsigned char *)s; + + for (int i = 0; i < n; i++) { + cs[i] = (unsigned char)c; + } + return s; +} +int memcmp(const void *s1, const void *s2, size_t n) +{ + if (s1 == s2) { + return 0; + } + + unsigned char *p = (unsigned char *)s1; + unsigned char *q = (unsigned char *)s2; + while (n-- != 0) { + if (*p != *q) { + return (*p > *q) ? 1 : -1; + } + p++; + q++; + } + return 0; +} +# if defined(__GNUC__) && !defined(__clang__) +# pragma GCC pop_options +# endif +#endif diff --git a/benchmark/benchmark.php b/benchmark/benchmark.php index a0c01ca76623..f45d7086c780 100644 --- a/benchmark/benchmark.php +++ b/benchmark/benchmark.php @@ -21,12 +21,12 @@ function main() { if (false !== $branch = getenv('GITHUB_REF_NAME')) { $data['branch'] = $branch; } - $data['Zend/bench.php'] = runBench(false); - $data['Zend/bench.php JIT'] = runBench(true); + // $data['Zend/bench.php'] = runBench(false); + // $data['Zend/bench.php JIT'] = runBench(true); $data['Symfony Demo 2.2.3'] = runSymfonyDemo(false); - $data['Symfony Demo 2.2.3 JIT'] = runSymfonyDemo(true); + // $data['Symfony Demo 2.2.3 JIT'] = runSymfonyDemo(true); $data['Wordpress 6.2'] = runWordpress(false); - $data['Wordpress 6.2 JIT'] = runWordpress(true); + // $data['Wordpress 6.2 JIT'] = runWordpress(true); $result = json_encode($data, JSON_PRETTY_PRINT) . "\n"; fwrite(STDOUT, $result); @@ -107,6 +107,16 @@ function runValgrindPhpCgiCommand( if ($jit) { $profileOut .= '.jit'; } + $i = 1; + while (true) { + $tmp = $profileOut . '.' . $i; + if (file_exists($tmp)) { + $i++; + } else { + $profileOut = $tmp; + break; + } + } $process = runCommand([ 'valgrind',