[Bps-public-commit] Prophet branch, master, updated. 0.743-17-gec69592
Jesse Vincent
jesse at bestpractical.com
Sun Sep 5 20:51:09 EDT 2010
The branch, master has been updated
via ec69592106a8ad49a1fd158d6fcc2234a0814cb6 (commit)
from 2c47e476d8dda9fc650169068d0f31741a157a01 (commit)
Summary of changes:
lib/Prophet/Change.pm | 3 ++-
lib/Prophet/FilesystemReplica.pm | 6 ++++--
lib/Prophet/Replica/FS/Backend/File.pm | 6 ++++--
lib/Prophet/Util.pm | 3 ++-
4 files changed, 12 insertions(+), 6 deletions(-)
- Log -----------------------------------------------------------------
commit ec69592106a8ad49a1fd158d6fcc2234a0814cb6
Author: Jesse Vincent <jesse at bestpractical.com>
Date: Sun Sep 5 20:53:33 2010 -0400
Disable validation in a few of the places it was being most abusive of
performance
diff --git a/lib/Prophet/Change.pm b/lib/Prophet/Change.pm
index 52ac548..43a8be6 100644
--- a/lib/Prophet/Change.pm
+++ b/lib/Prophet/Change.pm
@@ -109,7 +109,8 @@ Takes a C<name>, and the C<old> and C<new> values.
sub add_prop_change {
my $self = shift;
- my %args = validate( @_, { name => 1, old => 0, new => 0 } );
+ my %args = (@_); # validate is far too heavy to be called here
+ # my %args = validate( @_, { name => 1, old => 0, new => 0 } );
my $change = Prophet::PropChange->new(
name => $args{'name'},
old_value => $args{'old'},
diff --git a/lib/Prophet/FilesystemReplica.pm b/lib/Prophet/FilesystemReplica.pm
index 3de5e9e..24ee458 100644
--- a/lib/Prophet/FilesystemReplica.pm
+++ b/lib/Prophet/FilesystemReplica.pm
@@ -57,13 +57,15 @@ sub read_file {
sub _read_file {
my $self = shift;
- my ($file) = validate_pos( @_, 1 );
+ my ($file) = (@_); # validation is too heavy to be called here
+ #my ($file) = validate_pos( @_, 1 );
$self->backend->read_file($file);
}
sub _write_file {
my $self = shift;
- my %args = validate( @_, { path => 1, content => 1 } );
+ my %args = (@_); # validate is too heavy to be called here
+ # my %args = validate( @_, { path => 1, content => 1 } );
$self->backend->write_file(%args);
}
diff --git a/lib/Prophet/Replica/FS/Backend/File.pm b/lib/Prophet/Replica/FS/Backend/File.pm
index da3f21c..afd34ea 100644
--- a/lib/Prophet/Replica/FS/Backend/File.pm
+++ b/lib/Prophet/Replica/FS/Backend/File.pm
@@ -9,7 +9,8 @@ has fs_root => ( is => 'rw', isa => 'Str');
sub read_file {
my $self = shift;
- my ($file) = validate_pos( @_, 1 );
+ my ($file) = (@_); # validation is too heavy to be called here
+ #my ($file) = validate_pos( @_, 1 );
return eval {
local $SIG{__DIE__} = 'DEFAULT';
Prophet::Util->slurp(
@@ -60,7 +61,8 @@ sub read_file_range {
sub write_file {
my $self = shift;
- my %args = validate( @_, { path => 1, content => 1 } );
+ my %args = (@_); # validation is too heavy to call here
+ #my %args = validate( @_, { path => 1, content => 1 } );
my $file = File::Spec->catfile( $self->fs_root => $args{'path'} );
Prophet::Util->write_file( file => $file, content => $args{content});
diff --git a/lib/Prophet/Util.pm b/lib/Prophet/Util.pm
index e37de4c..19dd58b 100644
--- a/lib/Prophet/Util.pm
+++ b/lib/Prophet/Util.pm
@@ -97,7 +97,8 @@ sub escape_utf8 {
sub write_file {
my $self = shift;
- my %args = validate( @_, { file => 1, content => 1 } );
+ my %args = (@_); #validate is too heavy to be called here
+ # my %args = validate( @_, { file => 1, content => 1 } );
my ( undef, $parent, $filename ) = File::Spec->splitpath($args{file});
unless ( -d $parent ) {
-----------------------------------------------------------------------
More information about the Bps-public-commit
mailing list