File_Passwd::crypt_apr_md5()

From: Date: Thu, 10 Feb 2005 17:12:23 +0000
Subject: File_Passwd::crypt_apr_md5()
References: 1 2 3 4 5  Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-36129@lists.php.net to get a copy of this message
Hi, I benched out the 2 versions, calculating and comparing 100 random length and content plaintexts. No return values differences so it's BC certainly. Here the profiling on my poor P3-500 FC2: +--------+-----------------+------------+------------+ | Method | Netto Time (ms) | Time (ms) | Percentage | +--------+-----------------+------------+------------+
| Origin |       31,314.98 |  31,314.98 |      82.68 |
| Ants   |        6,371.73 |   6,371.73 |      16.82 |
| Global |          188.37 |  37,875.09 |     100.00 |
+--------+-----------------+------------+------------+ _Resource usage_ Array // 0=number of calls, 1=ru_utime, 2=ru_stime, 3=ru_minflt ( [Origin] => Array
       (
           [0] => 100
           [1] => 30.928295
           [2] => 0.015997
           [3] => 211
       )
[Ants] => Array
       (
           [0] => 100
           [1] => 6.287044
           [2] => 0.003
           [3] => 9
       )
) ru for time give same ratio as Benchmark::Profiler(). Means 5 times quicker, but sure better on powerfull machines :( à+ -- bertrand Gugger (toggg) Ants Aasma wrote: > Michael Wallner wrote: > >> <plug> >> Well, sorry for jumping in, but would you mind looking at >> File_Passwd::crypt_apr_md5()? ;-) That would definitly need some >> reasonable optimization... it takes about .25s for one passwd. >> </plug> > > > Ok, here you go, diff against File_Passwd 1.1.2 > http://www.hot.ee/stepz/Passwd.php.diff > > Old one: 83ms > New one: 8.3ms :) > > I could squeeze another 60% of performance out of it at 5.1ms by > taking the version check out of the main loop, composing the md5 > argument inline and taking the concatenations out of the loop, but > that looked godawful. You be the judge if the performance is worth the > code readibility. Diff's @ http://www.hot.ee/stepz/Passwd.php.diff2 > > ------ > Ants >

« previous php.pear.dev (#36129) next »