Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
test diff sizes
my $f = shift @ARGV;
runcmd(" $f");
our $N=16;
for (my $iter=1; $iter<= $ITERATIONS; $iter++) {
for (my $i=1; $i<$N; $i++) {
my $x = 2 ** $i;
my $df = "DIFF-$i.owl";
my $cmd = "owljs-remove-random-axioms -n $x -o $df $f";
runcmd(" $df");
foreach my $fmt (qw(owl ofn obo ttl omn)) {
my $out = runcmd("diff $df.$fmt $f.$fmt | wc -l");
print STDERR "OUT: $out\n";
if ($out =~ /^\s*(\d+)/) {
print "$fmt\t$i\t$1\t$iter\n";
else {
exit 0;
sub runcmd {
my $c = shift;
print STDERR "CMD: $c\n";
open(F, "$c|") || die $c;
my $out = join("",<F>);
chomp $out;
$out =~ s/^\s+//;
$out =~ s/\s+$//;
return $out;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment