insensate has asked for the wisdom of the Perl Monks concerning the following question:
My task is to create a list of identifiers from set 2 where the datestamp is not equal to the corresponding stamp in set 1. This is my code:Set 1 (@data): g123|10249875 g948|32004040 Set 2 (@ref): g123:1|10249870 g123:2|10249875 g123:3|10249871 g984:2|94950595 g984:1|32004040
...And the id's I am looking for end up in @set:foreach $elem(@data){ ($sub,$max)=split/\|/,$elem; @found=grep /^$sub:/,@ref; foreach $f(@found){ ($id,$time)=split/\|/,$f; if($time ne $max){ push @set,$id; } } }
Sadly, this method is prohibitively slow. I am looking for suggestions on how to make this process more efficient.@set: g123:1 g123:3 g984:2
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Large Set Efficiency Question
by kvale (Monsignor) on Jul 29, 2002 at 22:53 UTC | |
|
Re: Large Set Efficiency Question
by Bird (Pilgrim) on Jul 29, 2002 at 22:48 UTC | |
|
Re: Large Set Efficiency Question
by dpuu (Chaplain) on Jul 29, 2002 at 22:59 UTC | |
by jackdied (Monk) on Jul 30, 2002 at 00:12 UTC | |
|
Re: Large Set Efficiency Question
by BorgCopyeditor (Friar) on Jul 29, 2002 at 22:43 UTC | |
|
Re: Large Set Efficiency Question
by jlongino (Parson) on Jul 29, 2002 at 22:56 UTC |