mirror of
https://github.com/php/php-src.git
synced 2026-03-27 17:52:16 +01:00
The $Id$ keywords were used in Subversion where they can be substituted with filename, last revision number change, last changed date, and last user who changed it. In Git this functionality is different and can be done with Git attribute ident. These need to be defined manually for each file in the .gitattributes file and are afterwards replaced with 40-character hexadecimal blob object name which is based only on the particular file contents. This patch simplifies handling of $Id$ keywords by removing them since they are not used anymore.
92 lines
1.9 KiB
PHP
92 lines
1.9 KiB
PHP
<?php
|
|
|
|
/*
|
|
This gives rather interesting results :)
|
|
|
|
Measures on a Notebook P4M-1.7 256MB Windows 2000:
|
|
sha1 0.556691
|
|
tiger160,3 0.774469
|
|
tiger192,3 0.776314
|
|
tiger128,3 0.777004
|
|
ripemd128 0.896674
|
|
sha256 1.011164
|
|
md5 1.016032
|
|
tiger160,4 1.056617
|
|
tiger128,4 1.063101
|
|
tiger192,4 1.069258
|
|
haval160,3 1.125099
|
|
haval128,3 1.125679
|
|
haval224,3 1.128017
|
|
haval192,3 1.130026
|
|
haval256,3 1.134846
|
|
ripemd160 1.150693
|
|
haval128,4 1.686261
|
|
haval192,4 1.687274
|
|
haval160,4 1.693091
|
|
haval256,4 1.699323
|
|
haval224,4 1.743094
|
|
haval160,5 2.003452
|
|
haval192,5 2.008341
|
|
haval256,5 2.009048
|
|
haval128,5 2.009555
|
|
haval224,5 2.015539
|
|
sha384 3.370734
|
|
sha512 3.381121
|
|
whirlpool 6.912327
|
|
snefru 9.268168
|
|
|
|
Measures on a Desktop P4-2.4 512MB Debian (Linux-2.4):
|
|
md5 0.147739
|
|
haval128,3 0.317006
|
|
haval192,3 0.317524
|
|
haval256,3 0.317526
|
|
haval160,3 0.323035
|
|
haval224,3 0.333318
|
|
ripemd128 0.353447
|
|
sha1 0.376200
|
|
ripemd160 0.413758
|
|
sha256 0.435957
|
|
haval160,4 0.452357
|
|
haval224,4 0.454531
|
|
haval128,4 0.458026
|
|
haval256,4 0.459051
|
|
haval192,4 0.468094
|
|
haval128,5 0.524262
|
|
haval160,5 0.529573
|
|
haval224,5 0.533655
|
|
haval256,5 0.534446
|
|
haval192,5 0.543726
|
|
tiger128,3 0.577975
|
|
tiger160,3 0.579951
|
|
tiger192,3 0.597111
|
|
tiger192,4 0.781408
|
|
tiger160,4 0.801243
|
|
tiger128,4 0.812239
|
|
sha512 1.298627
|
|
sha384 1.313607
|
|
whirlpool 1.556159
|
|
snefru 5.703742
|
|
|
|
*/
|
|
|
|
error_reporting(E_ALL&~E_NOTICE);
|
|
|
|
$data = file_get_contents(__FILE__);
|
|
$time = array();
|
|
|
|
for ($j = 0; $j < 10; $j++) {
|
|
foreach (hash_algos() as $algo) {
|
|
$start = microtime(true);
|
|
for ($i = 0; $i < 1000; $i++) {
|
|
hash($algo, $data);
|
|
}
|
|
$time[$algo] += microtime(true)-$start;
|
|
}
|
|
}
|
|
|
|
asort($time, SORT_NUMERIC);
|
|
foreach ($time as $a => $t) {
|
|
printf("%-12s %02.6f\n", $a, $t);
|
|
}
|
|
?>
|