in reply to Script far too slow with large files - wisdom needed!

I doubt it will speed things up much, but looking through a hash is generally quicker than looking through an array. Change @IDS to %IDS, then you don't need the grep.
$IDS{$id}++; ... if ($A+$B == 2 && (exists $IDS{$TI})){

Replies are listed 'Best First'.
Re^2: Script far too slow with large files - wisdom needed!
by choroba (Cardinal) on Jan 21, 2016 at 16:32 UTC
    Turning the second if into an elsif might also save some microseconds.
    ($q=q:Sq=~/;[c](.)(.)/;chr(-||-|5+lengthSq)`"S|oS2"`map{chr |+ord }map{substrSq`S_+|`|}3E|-|`7**2-3:)=~y+S|`+$1,++print+eval$q,q,a,