Subject: | A pointer mismatch and some suggestions for more perf tests. |
Thanks for XML::Bare 0.27
My compiler is suggesting that:
struct attc *self = (struct nodec *) malloc( size );
......................^
%CC-W-PTRMISMATCH, In the initializer for self, the referenced type of
the pointer value "(struct nodec ...)malloc(...)" is
"struct nodec", which is not compatible with "struct attc".
at line number 52 in file PARSER.C
I think this should be:
struct attc *self = (struct attc *) malloc( size );
I also added this to the start of test.pl because I thought it might
ensure that the first test was not taking a hit reading the file.
open(DISKCACHE,'<', $file) or die "Couldn't open $!";
while(<DISKCACHE>){
my $line=$_;
}
close(DISKCACHE);
and I added these to the end, just because I was wanted to compare them:
if( $ARGV[0] eq '14' ) {
($s, $usec) = gettimeofday();
if( eval( "require XML::Parser;" ) ) {
($s2, $usec2) = gettimeofday();
my $parser = new XML::Parser();
my $doc = $parser->parsefile( $file );
($s3, $usec3) = gettimeofday();
$sa = $s2-$s + (($usec2-$usec)/1000000);
$sb = $s3-$s2 + (($usec3-$usec2)/1000000);
$sc = $s3-$s + (($usec3-$usec)/1000000);
$sa /= $base1; $sb /= $base2; $sc /= $base3;
$sa = fixed( $sa ); $sb = fixed( $sb ); $sc = fixed( $sc );
print 'XML::Parser '.$sa." ".$sb." ".$sc."\n";
}
}
if( $ARGV[0] eq '15' ) {
($s, $usec) = gettimeofday();
if( eval( "require XML::Parser::Expat;" ) ) {
($s2, $usec2) = gettimeofday();
my $parser = new XML::Parser::Expat();
sub noop{}
$parser->setHandlers('Start' => \&noop,
'End' => \&noop,
'Char' => \&noop);
open(FOO, $file) or die "Couldn't open $!";
$parser->parse(*FOO);
close(FOO);
($s3, $usec3) = gettimeofday();
$sa = $s2-$s + (($usec2-$usec)/1000000);
$sb = $s3-$s2 + (($usec3-$usec2)/1000000);
$sc = $s3-$s + (($usec3-$usec)/1000000);
$sa /= $base1; $sb /= $base2; $sc /= $base3;
$sa = fixed( $sa ); $sb = fixed( $sb ); $sc = fixed( $sc );
print 'XML::Parser::Expat '.$sa." ".$sb." ".$sc."\n";
}
}
Cheers,
Peter (Stig) Edwards