Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F30170260
raw.txt
No One
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Authored By
Jdforrester-WMF
Aug 30 2019, 9:57 PM
2019-08-30 21:57:59 (UTC+0)
Size
828 B
Referenced Files
None
Subscribers
None
raw.txt
View Options
<?php
$dataS = @file_get_contents( './foo.data' );
$dataJ = @file_get_contents( './foo.json' );
// file_put_contents( './foo.json', json_encode( unserialize( $dataS ), JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE ) . "\n" );
function runS() {
global $dataS;
ob_start();
$t = microtime( true );
$i = 0;
while($i < 10000) {
unserialize( $dataS );
++$i;
}
$tmp = microtime(true) - $t;
ob_end_clean();
return $tmp;
}
// Test Source
function runJ() {
global $dataJ;
ob_start();
$t = microtime( true );
$i = 0;
while($i < 10000) {
json_decode( $dataJ );
++$i;
}
$tmp = microtime(true) - $t;
ob_end_clean();
return $tmp;
}
echo( 'Serial: ' . runS() . "\n" );
echo( 'JSON: ' . runJ() . "\n" );
File Metadata
Details
Attached
Mime Type
text/plain; charset=utf-8
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
7904134
Default Alt Text
raw.txt (828 B)
Attached To
Mode
P9016 (An Untitled Masterwork)
Attached
Detach File
Event Timeline
Log In to Comment