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

subst_translate_stream inefficiency

From: Chia-liang Kao <clkao_at_clkao.org>
Date: 2003-08-21 22:02:23 CEST

Hi,

During my development of SVN::Stream (bidirectional svn_stream
and perl io object interpolation), i found that libsvn_client's
cat is doing 1 byte write to the stream instead of chunks.

So I found this happends when svn:keyword or eol-style is set
on the file. altough the actual disk write will not happen every
write, <filesize> numbers of call to stream->write is still scary.

Attached is a script using the perl bindings to do some statistics
of the writes, and here is the result:

client.pl http://svn.collab.net/repos/svn/trunk/subversion/mod_authz_svn/mod_autz_svn.c
11001 writes at /tmp/client.pl line 19.
client.pl http://svn.collab.net/repos/svn/trunk/subversion/mod_authz_svn/INSTALL
7 writes writes at /tmp/client.pl line 18.

Cheers,
CLK

#!/usr/bin/perl
package PerlIO::via::count;

use strict;
sub PUSHED { bless \*PUSHED,$_[0] }
sub FILL { readline( $_[1] ) }

my $write_cnt;

sub WRITE {
    $write_cnt++;
    print {$_[2]} $_[1];
    return length($_[1]);
} #WRITE

END {
    warn "$write_cnt writes";
}

1;

package main;

use SVN::Core;
use SVN::Client ();

my $ctx = SVN::_Client::new_svn_client_ctx_t;
$ctx->auth_baton (SVN::Core::auth_open ([SVN::Client::get_username_provider]));

open( my $out,'>:via(count)','/dev/null' );
SVN::Client::cat ($out, shift, 'HEAD', $ctx);

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Thu Aug 21 22:03:07 2003

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.