mirror of
https://github.com/halaxa/json-machine.git
synced 2025-01-18 05:28:14 +01:00
Performance testing with debug
This commit is contained in:
parent
e75a68acc8
commit
129d59f79f
@ -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);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user