note 82924 deleted from function.uniqid by danbrown

From: Date: Fri, 27 Jun 2008 15:22:23 +0000
Subject: note 82924 deleted from function.uniqid by danbrown
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-140874@lists.php.net to get a copy of this message
Note Submitter: jan at NOSPAM dot cepelak dot cz ---- Well, I am also wondering, how slow uniqID is. In loop of my script, with just a 500.000 itterations, bring my script from 12s to 120s. As somebody bellow noticed, yeah, to be completly uniq, has to count with MD5 collisions and also fact, script can be hosted in some kind of cluster webhosting, and, I guess, uniqID is based on system time which is different on different machines in cluster. What confuse me (and I found its terribly slow quite late, during implementing script in server), uniqID is extremly slow only in my linux server, not in windows testing machine. The same script tooks 15s in Win machine and the same script tooks 120s in linux one. After hours, tracing where the slowing comes from, I found its uniqID (plus the difference between CPUs, Win's one is quite old celeron, server has dualcore Opteron).

« previous php.notes (#140874) next »