<commit_before>package Redis::hiredis;

use strict;
our $VERSION = "0.10.2";
require XSLoader;
XSLoader::load('Redis::hiredis', $VERSION);

our $AUTOLOAD;

sub new {
    my($class, %args) = @_;

    if(!exists $args{utf8}) {
        $args{utf8} = 1;
    }

    my $self = $class->_new($args{utf8});

    if(exists $args{host}) {
        $self->connect($args{host}, defined $args{port} ? $args{port} : 6379);
    }
    elsif (exists $args{path}) {
        $self->connect_unix($args{path});
    }

    return $self;
}

sub AUTOLOAD {
    my $self = shift;
    (my $method = $AUTOLOAD) =~ s/.*:://;
    $self->command($method, @_);<commit_msg>Caching method in AUTOLOAD for more performance<commit_after>package Redis::hiredis;

use strict;
our $VERSION = "0.10.2";
require XSLoader;
XSLoader::load('Redis::hiredis', $VERSION);

our $AUTOLOAD;

sub new {
    my($class, %args) = @_;

    if(!exists $args{utf8}) {
        $args{utf8} = 1;
    }

    my $self = $class->_new($args{utf8});

    if(exists $args{host}) {
        $self->connect($args{host}, defined $args{port} ? $args{port} : 6379);
    }
    elsif (exists $args{path}) {
        $self->connect_unix($args{path});
    }

    return $self;
}

sub AUTOLOAD {
    (my $method = $AUTOLOAD) =~ s/.*:://;

    # cache method for future calls
    no strict 'refs';
    *$AUTOLOAD = sub { shift->command($method, @_) };

    goto $method;
{'fraction_non_alphanumeric': 0.19626168224299065, 'fraction_numerical': 0.017253774263120056, 'mean_word_length': 3.0821114369501466, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6051679', 'n_tokens_mistral': 541, 'n_tokens_neox': 536, 'n_words': 109}