From 129d59f79f368f55e8f36adf5477192426716e39 Mon Sep 17 00:00:00 2001 From: Filip Halaxa Date: Thu, 16 Dec 2021 16:55:32 +0100 Subject: [PATCH] Performance testing with debug --- test/performance/testPerformance.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/test/performance/testPerformance.php b/test/performance/testPerformance.php index dabbcd1..d714a33 100644 --- a/test/performance/testPerformance.php +++ b/test/performance/testPerformance.php @@ -17,6 +17,12 @@ $decoders = [ 'JsonMachine::fromString()' => function ($file) { return JsonMachine::fromString(stream_get_contents(fopen($file, 'r'))); }, + 'JsonMachine::fromFile() - debug' => function ($file) { + return JsonMachine::fromFile($file, '', null, true); + }, + 'JsonMachine::fromString() - debug' => function ($file) { + return JsonMachine::fromString(stream_get_contents(fopen($file, 'r')), '', null, true); + }, 'json_decode()' => function ($file) { return json_decode(stream_get_contents(fopen($file, 'r')), true); }, @@ -37,7 +43,7 @@ foreach ($decoders as $name => $decoder) { $textResult = round($fileSizeMb/$time, 2) . ' MB/s'; } - echo "$name: $textResult".PHP_EOL; + echo str_pad($name.": ", 37, '.')." $textResult".PHP_EOL; } @unlink($tmpJsonFileName);