Welcome Guest, Not a member yet? Register   Sign In
Little bug fix for is_really_writable in common.php
#2

[eluser]Derek Jones[/eluser]
uniqid() has some performance implications on certain environments, and should be avoided in situations that might loop or get called frequently together. Basically on some servers use of that function triggers a sleep signal of around .02 seconds (instead of 1 millisecond like it's supposed to) so that it can be ensured that simultaneous requests don't get the same value for this call. May not sound like a lot, but 2 full seconds for 100 requests adds up. This might be an acceptable alternative though:

Code:
$file = rtrim($file, '/').'/'.md5(mt_rand(1,100).mt_rand(1,100));

Are you sure the permissions on this folder are correct, that it has not only read and write but also modify (or whatever it's referred to as in Windows these days)?


Messages In This Thread
Little bug fix for is_really_writable in common.php - by El Forum - 04-21-2009, 06:43 PM
Little bug fix for is_really_writable in common.php - by El Forum - 04-23-2009, 10:25 AM
Little bug fix for is_really_writable in common.php - by El Forum - 04-27-2009, 08:12 PM
Little bug fix for is_really_writable in common.php - by El Forum - 04-28-2009, 07:57 AM



Theme © iAndrew 2016 - Forum software by © MyBB