You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by hw...@apache.org on 2010/10/20 20:23:16 UTC
svn commit: r1025660 -
/subversion/branches/performance/subversion/libsvn_subr/io.c
Author: hwright
Date: Wed Oct 20 18:23:15 2010
New Revision: 1025660
URL: http://svn.apache.org/viewvc?rev=1025660&view=rev
Log:
On the performance branch:
* subversion/libsvn_subr/io.c:
After on-list discussion, revert parts of r985472. See this post for
further enlightenment:
http://svn.haxx.se/dev/archive-2010-10/0257.shtml
The crux is that callers which don't care about specific names have an
API to use for that matter, so we shouldn't be introducing additional
randomness here.
Modified:
subversion/branches/performance/subversion/libsvn_subr/io.c
Modified: subversion/branches/performance/subversion/libsvn_subr/io.c
URL: http://svn.apache.org/viewvc/subversion/branches/performance/subversion/libsvn_subr/io.c?rev=1025660&r1=1025659&r2=1025660&view=diff
==============================================================================
--- subversion/branches/performance/subversion/libsvn_subr/io.c (original)
+++ subversion/branches/performance/subversion/libsvn_subr/io.c Wed Oct 20 18:23:15 2010
@@ -378,11 +378,6 @@ svn_io_open_uniquely_named(apr_file_t **
if (delete_when == svn_io_file_del_on_close)
flag |= APR_DELONCLOSE;
- /* Increase the chance that rand() will return something truely
- independent from what others get or do. */
- if (i == 2)
- srand((unsigned int)apr_time_now());
-
/* Special case the first attempt -- if we can avoid having a
generated numeric portion at all, that's best. So first we
try with just the suffix; then future tries add a number
@@ -393,16 +388,11 @@ svn_io_open_uniquely_named(apr_file_t **
This is good, since "1" would misleadingly imply that
the second attempt was actually the first... and if someone's
got conflicts on their conflicts, we probably don't want to
- add to their confusion :-).
-
- Also, the randomization used to minimize the number of re-try
- cycles will interfere with certain tests that compare working
- copies etc.
- */
+ add to their confusion :-). */
if (i == 1)
unique_name = apr_psprintf(scratch_pool, "%s%s", path, suffix);
else
- unique_name = apr_psprintf(scratch_pool, "%s.%u_%x%s", path, i, rand(), suffix);
+ unique_name = apr_psprintf(scratch_pool, "%s.%u_%s", path, i, suffix);
/* Hmmm. Ideally, we would append to a native-encoding buf
before starting iteration, then convert back to UTF-8 for