Re: [PHP] Use PHP or MySQL for MD5 function

2003-08-26 Thread Curt Zirzow
* Thus wrote Daevid Vincent ([EMAIL PROTECTED]):
> 
> If you really care, just make a program like this and do some MD5() calls in
> both mysql and php to see which is faster. I'd be curious to know as well...
> You'll have to modify appropriately, and only do a single MD5 check because
> I think looping 1 mysql MD5 calls will be slower automatically since
> there is the connection to the db and stuff to contend with, so keep that in
> mind.
> 
Another factor with this is the length of the data is for md5(). If
the data is really long there will be communication overhead, with
md5'ing with php.

Curt
-- 
"I used to think I was indecisive, but now I'm not so sure."

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] Use PHP or MySQL for MD5 function

2003-08-25 Thread Daevid Vincent
Well, IMHO it's better to use PHP. My reasoning is this: you want to hit the
db and get out of there as quick as possible since you have limited threads.
Plus, I try to keep my code as db agnostic as possible, so that it's
portable. Having said that, if it's a quick project or something simple, I'd
probably use the mysql version just for the ease of use factor. 

If you really care, just make a program like this and do some MD5() calls in
both mysql and php to see which is faster. I'd be curious to know as well...
You'll have to modify appropriately, and only do a single MD5 check because
I think looping 1 mysql MD5 calls will be slower automatically since
there is the connection to the db and stuff to contend with, so keep that in
mind.


Daevid Vincent
http://daevid.com

--- test ---


blah 
version one: \t$time1 seconds\n";
echo "version two: \t$time2 seconds\n";
?>

 

> -Original Message-
> From: Sid [mailto:[EMAIL PROTECTED] 
> Sent: Monday, August 25, 2003 1:25 PM
> To: [EMAIL PROTECTED]
> Subject: [PHP] Use PHP or MySQL
> 
> 
> Hello,
> 
> This question has been lingering in my mind for some time -
> Say we have a function such as MD5, which is available on 
> both PHP and MySQL? Which is faster - the PHP version or the 
> MySQL one. Have any benchmarks been made on this? We can use 
> the same question for say... arithmetic operations, string 
> contentation...
> 
> Thanks in advance.
> 
> - Sid 
> 

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php