|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesUniqid (last revision 2010-04-22 06:32 UTC by mwoolf at mcomi dot net)Pull RequestsHistoryAllCommentsChangesGit/SVN commits
[2006-11-13 22:41 UTC] iliaa@php.net
[2006-11-21 01:00 UTC] php-bugs at lists dot php dot net
[2007-08-09 13:03 UTC] franz dot sedlmaier at gmx dot net
[2010-11-13 10:18 UTC] Mikhail dot V dot Gavrilov at gmail dot com
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Fri Oct 24 05:00:02 2025 UTC |
Description: ------------ See #37106 first. Ok, this may be "bogus", but is there a workaround or some other unique id generator in PHP? I've spent 2 days trying to figure out why my webapp was *so slow* on production server, when on develop/test environments it was acceptable... At last, I profiled (APD) it and discovered that uniqid() was terribly slow. I searched for some big problem in my app then, without any other clue, I commented out the usleep() call in uniqid.c: magically, a page that took 10 seconds now responded under 1 sec! I tried with the following lines instead of usleep(), but with the same problem: struct timespec tsq; tsq.tv_sec = 0; tsq.tv_nsec = 1; nanosleep(&tsq, NULL); FYI, I "patched" PHP 5.1.4, and the server with the problem runs an updated RHEL 3 (Linux 2.4.21-40.ELsmp).