[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

svn_sleep_for_timestamps makes things unresponsive

From: C.A.T.Magic <c.a.t.magic_at_gmx.at>
Date: 2004-06-25 00:10:46 CEST

Hi subversion dev's,

some time ago I wondered why most svn commands appear to be
very slow, no matter how small the operation is
or even if it does nothing at all.
this is especially problematic if running test cases
that require to push many revisions.

Gred Hudson pointed me to 'svn_sleep_for_timestamps'.

today i found some time to verify this and added some
debugoutput into the svn_sleep_for_timestamps function.
this is indeed the reason for the 'slowness'.

svn_sleep_for_timestamps ALWAYS waits 1.10 seconds.

-) i think it's in several situations called unneccesarily.

-) NTFS has a resolution of less than 1 _microsecond_,
    so a wait for a microsecond would be more than enough.

-) FAT has a resolution of 2 (TWO) seconds, so the
    code would probably break.
    Filetimes are rounded to the next representable
    -later- filetime (at least on WIN32),
    which means if you write a file at 00:00:00.10
    it gets a FAT filetime of 00:00:02.00
    * could lead to data loss with a WC on FAT?

an example for an unessessary call
to svn_sleep_for_timestamps:

X:\SVNSandbox\TestFS\Work1>svn update
[timestamp.sleep]
At revision 1671.

X:\SVNSandbox\TestFS\Work1>svn update
[timestamp.sleep]
At revision 1671.

X:\SVNSandbox\TestFS\Work1>svn update
[timestamp.sleep]
At revision 1671.

completes in ~3.01 seconds --> but could run in <0.01

---
svn is so lightning fast if I remove the call to
     apr_sleep (then - now);
or replace it with a smaller time period,
I think you should really have a look into this.
---
a very simple approach could be:
create a temporary file, stat() for its filetime
and then wait until that time has passed.
or repeatedly create a temp file every 10 milliseconds,
and check its time until the time is different.
or make it a config option?
or make the sleep #ifndef WIN32 ?
best wishes,
c.a.t.
P.S.: even if I completely remove the sleep() call everything
(fast test loop of change+update) seems to work fine (with NTFS)
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Fri Jun 25 00:11:26 2004

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.