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

Re: NFS and fsfs: slow commit performance

From: Blair Zajac <blair_at_orcaware.com>
Date: Mon, 17 Jan 2011 23:34:54 -0800

On 1/17/11 9:28 PM, Blair Zajac wrote:
> On 1/17/11 8:42 PM, Blair Zajac wrote:
> The random implementation seems a little harder, for a portable one, possible
> implementations:
>
> 1) apr_generate_random_bytes()
> On Unix, this opens DEV_RANDOM, which seems heavy for this issue.
>
> 2) apr_md5_init()
> Hash the current time and lock file path would be good enough, then xor the
> high 8 bytes into the low 8 bytes and then modulo 100ms.

Talking to myself here, I decided to go with a 32-bit FNV-1a implementation to
hash apr_time_now() each time apr_file_open(APR_EXCL) fails. Much cheaper than
an md5.

This code is in the public domain:

http://isthe.com/chongo/tech/comp/fnv/

Any issues copying implementation into svn? From
http://isthe.com/chongo/src/fnv/fnv.h

  * Please do not copyright this code. This code is in the public domain.
  *
  * LANDON CURT NOLL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
  * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO
  * EVENT SHALL LANDON CURT NOLL BE LIABLE FOR ANY SPECIAL, INDIRECT OR
  * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF
  * USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
  * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
  * PERFORMANCE OF THIS SOFTWARE.
  *
  * By:
  * chongo <Landon Curt Noll> /\oo/\
  * http://www.isthe.com/chongo/
  *
  * Share and Enjoy! :-)

Blair
Received on 2011-01-18 08:35:34 CET

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.