Browse Source

[Swoole] Update to php 8.1 (#6902)

* Add jit that now is working

* Update to php 8.1

* Clean code

* Update swoole to v4.8.0 with postgres
Joan Miquel 3 years ago
parent
commit
b0a4970940

+ 3 - 3
frameworks/PHP/swoole/benchmark_config.json

@@ -14,7 +14,7 @@
       "database": "MySQL",
       "database": "MySQL",
       "framework": "swoole",
       "framework": "swoole",
       "language": "PHP",
       "language": "PHP",
-      "flavor": "PHP7",
+      "flavor": "PHP8.1",
       "orm": "Raw",
       "orm": "Raw",
       "platform": "swoole",
       "platform": "swoole",
       "webserver": "none",
       "webserver": "none",
@@ -35,7 +35,7 @@
       "database": "Postgres",
       "database": "Postgres",
       "framework": "swoole",
       "framework": "swoole",
       "language": "PHP",
       "language": "PHP",
-      "flavor": "PHP7",
+      "flavor": "PHP8",
       "orm": "Raw",
       "orm": "Raw",
       "platform": "swoole",
       "platform": "swoole",
       "webserver": "none",
       "webserver": "none",
@@ -56,7 +56,7 @@
       "database": "MySQL",
       "database": "MySQL",
       "framework": "swoole",
       "framework": "swoole",
       "language": "PHP",
       "language": "PHP",
-      "flavor": "PHP7",
+      "flavor": "PHP8.1",
       "orm": "Raw",
       "orm": "Raw",
       "platform": "swoole",
       "platform": "swoole",
       "webserver": "none",
       "webserver": "none",

+ 0 - 2
frameworks/PHP/swoole/db-no-async.php

@@ -101,8 +101,6 @@ function updates(int $queries): string
         $query_count = $queries > 500 ? 500 : $queries;
         $query_count = $queries > 500 ? 500 : $queries;
     }
     }
 
 
-    $update    = '';
-
     while ($query_count--) {
     while ($query_count--) {
         $id = mt_rand(1, 10000);
         $id = mt_rand(1, 10000);
         Db::$random->execute([$id]);
         Db::$random->execute([$id]);

+ 3 - 0
frameworks/PHP/swoole/php.ini

@@ -1,3 +1,6 @@
 opcache.enable_cli=1
 opcache.enable_cli=1
 opcache.validate_timestamps=0
 opcache.validate_timestamps=0
 memory_limit = 512M
 memory_limit = 512M
+
+opcache.jit_buffer_size=128M
+opcache.jit=tracing

+ 1 - 1
frameworks/PHP/swoole/swoole-no-async.dockerfile

@@ -1,4 +1,4 @@
-FROM php:8.0-cli
+FROM php:8.1-rc-cli
 
 
 RUN pecl install swoole > /dev/null && \
 RUN pecl install swoole > /dev/null && \
     docker-php-ext-enable swoole
     docker-php-ext-enable swoole

+ 2 - 2
frameworks/PHP/swoole/swoole-postgres.dockerfile

@@ -2,8 +2,8 @@ FROM php:8.0-cli
 
 
 RUN docker-php-ext-install opcache  > /dev/null
 RUN docker-php-ext-install opcache  > /dev/null
 
 
-ENV SWOOLE_VERSION 4.6.1
-ENV SWOOLE_POSTGRES 4.6.1
+ENV SWOOLE_VERSION 4.8.0
+ENV SWOOLE_POSTGRES 4.8.0
 
 
 RUN     apt-get update && apt-get install -y libpq-dev \
 RUN     apt-get update && apt-get install -y libpq-dev \
         && cd /tmp && curl -sSL "https://github.com/swoole/swoole-src/archive/v${SWOOLE_VERSION}.tar.gz" | tar xzf - \
         && cd /tmp && curl -sSL "https://github.com/swoole/swoole-src/archive/v${SWOOLE_VERSION}.tar.gz" | tar xzf - \

+ 1 - 1
frameworks/PHP/swoole/swoole.dockerfile

@@ -1,4 +1,4 @@
-FROM php:8.0-cli
+FROM php:8.1-rc-cli
 
 
 RUN pecl install swoole > /dev/null && \
 RUN pecl install swoole > /dev/null && \
     docker-php-ext-enable swoole
     docker-php-ext-enable swoole