Mantis Bugtracker
  

Viewing Issue Simple Details Jump to Notes ] View Advanced ] Issue History ] Print ]
ID Category Severity Reproducibility Date Submitted Last Update
0003297 [Quercus] major always 01-26-09 14:06 01-29-09 14:42
Reporter koreth View Status public  
Assigned To ferg
Priority normal Resolution fixed  
Status closed   Product Version 4.0.0
Summary 0003297: hash_hmac() is slow
Description <?php
$message = str_repeat('x', 1000);
$key = base64_decode("NMvhzq3jlze/4WlyuRXQ5w==");
$hash_key = base64_decode("CdMQm0q6JeUgalXRwQQZ1h/8WQA7fJh1OuY0xuZooxQ=");
$start = microtime(true);
for ($idx=0; $idx < 10000; $idx++) {
  $hash_val = hash_hmac('md5', $message, $hash_key, true);
}
print microtime(true) - $start;

This reports a run time of about 75ms under Zend PHP and about 610ms under Quercus in compiled mode (after repeated reloads to make sure the JVM has properly compiled everything.)
Additional Information
Attached Files

- Relationships

- Notes
(0003786)
ferg
01-29-09 14:42

With the improved performance, Quercus is still slower (by 2x on my system). The time is mostly spent inside the crypto routines. This may be a case where Java is just slower than C for highly numerical calculations.
 

- Issue History
Date Modified Username Field Change
01-26-09 14:06 koreth New Issue
01-29-09 14:42 ferg Note Added: 0003786
01-29-09 14:42 ferg Assigned To  => ferg
01-29-09 14:42 ferg Status new => closed
01-29-09 14:42 ferg Resolution open => fixed
01-29-09 14:42 ferg Fixed in Version  => 4.0.0


Mantis 1.0.0rc3[^]
Copyright © 2000 - 2005 Mantis Group
29 total queries executed.
26 unique queries executed.
Powered by Mantis Bugtracker