From 01ebf1620718e4c84752cd8d670954697639f161 Mon Sep 17 00:00:00 2001 From: joanhey Date: Sun, 29 Mar 2026 14:09:43 +0200 Subject: [PATCH 1/3] Faster json encode --- frameworks/workerman/server.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/frameworks/workerman/server.php b/frameworks/workerman/server.php index be6af884..629c492d 100644 --- a/frameworks/workerman/server.php +++ b/frameworks/workerman/server.php @@ -28,7 +28,7 @@ function largeJson() $item['total'] = $item['price'] * $item['quantity']; } - return json_encode(['items' => $data, 'count' => count($data)]); + return json_encode(['items' => $data, 'count' => count($data)], JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES); } $http_worker->onWorkerStart = static function () { @@ -59,7 +59,7 @@ function largeJson() } $connection->headers = ['Content-Type' => 'application/json']; - return $connection->send(json_encode(['items' => $total, 'count' => count($total)])); + return $connection->send(json_encode(['items' => $total, 'count' => count($total)]), JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES); case '/upload': $connection->headers = ['Content-Type' => 'text/plain']; From abe4b487cda76a502aa382bf2a2cdc0281f0b0ac Mon Sep 17 00:00:00 2001 From: joanhey Date: Sun, 29 Mar 2026 14:14:33 +0200 Subject: [PATCH 2/3] Fix typo --- frameworks/workerman/server.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frameworks/workerman/server.php b/frameworks/workerman/server.php index 629c492d..489d9a88 100644 --- a/frameworks/workerman/server.php +++ b/frameworks/workerman/server.php @@ -59,7 +59,7 @@ function largeJson() } $connection->headers = ['Content-Type' => 'application/json']; - return $connection->send(json_encode(['items' => $total, 'count' => count($total)]), JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES); + return $connection->send(json_encode(['items' => $total, 'count' => count($total)], JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES)); case '/upload': $connection->headers = ['Content-Type' => 'text/plain']; From 6616fac4890cb3fdde133d2768800196e19d0564 Mon Sep 17 00:00:00 2001 From: joanhey Date: Sun, 29 Mar 2026 14:36:31 +0200 Subject: [PATCH 3/3] Add new static files test --- frameworks/workerman/meta.json | 1 + 1 file changed, 1 insertion(+) diff --git a/frameworks/workerman/meta.json b/frameworks/workerman/meta.json index b88df84f..91c11bb4 100644 --- a/frameworks/workerman/meta.json +++ b/frameworks/workerman/meta.json @@ -14,6 +14,7 @@ "upload", "compression", "noisy", + "static", "mixed" ] }