Created
August 21, 2014 09:44
-
-
Save ao/8df01d879bcd0c368576 to your computer and use it in GitHub Desktop.
crc32test.php - Calculate crc32 loss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
ini_set('memory_limit', '16000M'); | |
$arrays = array(); | |
$total = 50000000; | |
for ($i=0; $i<$total; $i++) { | |
$arrays[crc32($i)] = ''; | |
} | |
echo $total."\n"; | |
echo count($arrays); | |
echo "\n"; | |
?> | |
php crc32test.php | |
-50000000 | |
-49727616 | |
=0.544768% |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment