ID:               37840
 Updated by:       [EMAIL PROTECTED]
 Reported By:      diego at caravana dot to
-Status:           Open
+Status:           Feedback
 Bug Type:         Performance problem
 Operating System: Linux 2.4.21
 PHP Version:      5.1.4
 New Comment:

Please try using this CVS snapshot:

  http://snaps.php.net/php5.2-latest.tar.gz
 
For Windows:
 
  http://snaps.php.net/win32/php5.2-win32-latest.zip




Previous Comments:
------------------------------------------------------------------------

[2006-06-18 17:21:08] diego at caravana dot to

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).



------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=37840&edit=1

Reply via email to