403Webshell
Server IP : 172.67.216.182  /  Your IP : 172.69.176.87
Web Server : Apache
System : Linux krdc-ubuntu-s-2vcpu-4gb-amd-blr1-01.localdomain 5.15.0-142-generic #152-Ubuntu SMP Mon May 19 10:54:31 UTC 2025 x86_64
User : www ( 1000)
PHP Version : 7.4.33
Disable Function : passthru,exec,system,putenv,chroot,chgrp,chown,shell_exec,popen,proc_open,pcntl_exec,ini_alter,ini_restore,dl,openlog,syslog,readlink,symlink,popepassthru,pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,imap_open,apache_setenv
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : ON
Directory :  /usr/share/doc/libbit-vector-perl/examples/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /usr/share/doc/libbit-vector-perl/examples/benchmk3.pl
#!/usr/bin/perl -w

package Bit::Vector;

use strict;

sub Pattern_Fill
{
    my($vector,$pattern,$length) = @_;
    my($size,$factor);

    $size = $vector->Size();
    $factor = int($size / $length);
    if ($size % $length) { $factor++; }
    $vector->Chunk_List_Store($length, ($pattern) x $factor);
    return $vector;
}

package main;

use strict;

use Bit::Vector;
use Benchmark;

my($i,$n);

my $b = 1024;

my(@v) = Bit::Vector->new($b,8);

$v[1]->Pattern_Fill(0x01,5);
$v[2]->Pattern_Fill(0x01,3);
$v[3]->Pattern_Fill(0x01,2);
$v[4]->Pattern_Fill(0x03,3);
$v[5]->Pattern_Fill(0x07,4);
$v[6]->Pattern_Fill(0x0F,5);
$v[7]->Fill();

for ( $i = 0; $i < 8; $i++ )
{
    $n = $v[$i]->to_Bin();
    print "\nTiming vector #$i:\n$n\n\n";
    timethese
    (
        500000,
        {
            'Norm1' => sub { $n = $v[$i]->Norm(); },
            'Norm2' => sub { $n = $v[$i]->Norm2(); },
            'Norm3' => sub { $n = $v[$i]->Norm3(); }
        }
    );
    print "<<< n = $n, b = $b, ", ( int( ($n / $b) * 1000 + 0.5 ) / 10 ), "% >>>\n";
}

__END__


Youez - 2016 - github.com/yon3zu
LinuXploit