|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2021-03-03 13:07 UTC] cmb@php.net
-Status: Open
+Status: Feedback
-Assigned To:
+Assigned To: cmb
[2021-03-03 13:07 UTC] cmb@php.net
[2021-03-03 13:15 UTC] rtrtrtrtrt at dfdfdfdf dot dfd
[2021-03-03 13:37 UTC] cmb@php.net
-Status: Feedback
+Status: Open
-Assigned To: cmb
+Assigned To:
[2021-03-03 13:37 UTC] cmb@php.net
[2021-03-03 13:44 UTC] rtrtrtrtrt at dfdfdfdf dot dfd
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Thu Nov 06 05:00:01 2025 UTC |
Description: ------------ for short messages crc32 seems to be the fastest way but for long messages like a whole page content for a ETAG-HTTP-Header it's the slowest md5: 0.48954606056213 sha1: 0.57872104644775 crc32: 0.64182901382446 that should not be the case on modern Intel CPUs like SnadyBrdige or newer which support a accelerated instruction Test script: --------------- $test_content = file_get_contents('global.inc.php', true); echo '<strong>md5: </strong>' . md5($test_content) . MY_LE; $profiler->reset(); for($x=1;$x<5000;$x++) { $rw = md5($test_content); } echo $profiler->get() . '<br /><br />' . MY_LE; echo '<strong>sha1: </strong>' . sha1($test_content) . MY_LE; $profiler->reset(); for($x=1;$x<5000;$x++) { $rw = sha1($test_content); } echo $profiler->get() . '<br /><br />' . MY_LE; echo '<strong>crc32: </strong>' . abs(crc32($test_content)) . MY_LE; $profiler->reset(); for($x=1;$x<5000;$x++) { $rw = crc32($test_content); } echo $profiler->get() . '<br /><br />' . MY_LE;