Skip Menu |

This queue is for tickets about the Bio-SamTools CPAN distribution.

Report information
The Basics
Id: 88203
Status: resolved
Priority: 0/
Queue: Bio-SamTools

People
Owner: Nobody in particular
Requestors: keiranmraine [...] gmail.com
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: Reduce overhead of Bio::DB::Bam::Alignment->strand (patch)
Hi Lincoln, Can I recommend the following edit to Bio::DB::Bam::Alignment->strand: Existing (commented lines removed for simplicity): sub strand { my $self = shift; return $self->reversed ? -1 : 1; # return 1; } Replacement: sub strand { return shift->reversed ? -1 : 1; } At present code calling strand takes 6us, this reduces the time to 4us (based on 500,000 calls). Regards, Keiran
I'm surprised there is any overhead for the redundant return statement, which should never be executed, but I suppose it interferes with compile optimization in some way. In any case, this patch will go into version 1.39. Lincoln