How to Compare two exe files One built from the old code now and the existing exe that was built a few months ago?
By : Better Wakeupnow
Date : March 29 2020, 07:55 AM
To fix this issue If all you're looking to do is verify the binaries are identical, then you could use a utility like md5sum or sha1sum which will effectively hashes the binary. If the hashes for each binary are the same, then the chances are the files are identical.
|
In Perl, is there a built in way to compare two arrays for equality?
By : Anurag Chauhan
Date : March 29 2020, 07:55 AM
around this issue There is the new smart match operator: code :
#!/usr/bin/perl
use 5.010;
use strict;
use warnings;
my @x = (1, 2, 3);
my @y = qw(1 2 3);
say "[@x] and [@y] match" if @x ~~ @y;
#!/usr/bin/perl
use strict;
use warnings;
use List::AllUtils qw( each_arrayref );
my @x = qw(1 2 3);
my @y = (1, 2, 3);
print "[@x] and [@y] match\n" if elementwise_eq( \(@x, @y) );
sub elementwise_eq {
my ($xref, $yref) = @_;
return unless @$xref == @$yref;
my $it = each_arrayref($xref, $yref);
while ( my ($x, $y) = $it->() ) {
return unless $x eq $y;
}
return 1;
}
#!/usr/bin/perl
use strict;
use warnings;
use Array::Compare;
use Benchmark qw( cmpthese );
use List::AllUtils qw( each_arrayref );
my @x = 1 .. 1_000;
my @y = map { "$_" } 1 .. 1_000;
my $comp = Array::Compare->new;
cmpthese -5, {
iterator => sub { my $r = elementwise_eq(\(@x, @y)) },
array_comp => sub { my $r = $comp->compare(\(@x, @y)) },
};
Rate iterator array_comp
iterator 246/s -- -75%
array_comp 1002/s 308% -- my @x = map { rand } 1 .. 1_000;
my @y = map { rand } 1 .. 1_000;
Rate array_comp iterator
array_comp 919/s -- -98%
iterator 52600/s 5622% -- my @x = 1 .. 20, map { rand } 1 .. 1_000;
my @y = 1 .. 20, map { rand } 1 .. 1_000;
Rate iterator array_comp
iterator 10014/s -- -23%
array_comp 13071/s 31% --
|
Performace of large 3D arrays: contiguous 1D storage vs T***
By : 박성운
Date : March 29 2020, 07:55 AM
|
Associative Arrays: Python vs Perl vs Awk Performace
By : Seong-Min Kang
Date : March 29 2020, 07:55 AM
|
how to compare mmap and read performace
By : Balaji
Date : March 29 2020, 07:55 AM
|