 execute with two files where n = 16000 and m = 100.
private static string[] GetDifferences( IEnumerable<string> source  
                                     , IEnumerable<string> target  
                                     , IEnumerable<int> ignoredIndices)
{
    var uniqueInSource = new List<string>();

    foreach (var sourceLine in source)
    {
        var found = false;
        var sourceSplit = sourceLine.Split('|').ToList();

        // filter out malformed lines
        if (sourceSplit.Count > 2 &&!int.TryParse(sourceSplit[2], out _))
        {
            continue;
        }

        foreach (var index in ignoredIndices)
        {
            sourceSplit.RemoveAt(index + 3);
        }

        foreach (var targetLine in source)
        {
            var targetSplit = targetLine.Split('|').ToList();

            if (targetSplit.Count > 2 &&!int.TryParse(targetSplit[2], out _))
            {
                continue;
            }

            foreach (var index in ignoredIndices)
            {
                targetSplit.RemoveAt(index + 3);
            }

            if (targetSplit.SequenceEqual(sourceSplit))
            {
                found = true;
                break;
            }
        }

        if (!found)
        {
            uniqueInSource.Add(string.Join("|", sourceLine));
        }
    }

    return uniqueInSource.ToArray();
}

I feel that my approach might be too naive since I think it's somewhere around O(m*n2).

A:

Your method is currently doing three things at a time and repeating the same logic multiple times:

parsing logs-1 (parsing a line)
parsing logs-2 (parsing a line again with the exact same code)
comparing both logs

It would be much easier to optimize and use it if you refactored it into  specialized structures/methods.

You put the first two cases into the static factory method Parse. It'll encapsulate the parsing part so you have implemented it only once. 
Then you need to encapsulate the equality. You do this by implementing the IEquatable<LogLine> interface.
execute with two files where n = 16000 and m = 100. 
 private static chain [ ] GetDifferences (IEnumerable < string > source  
                                     , IEnumerable < string > target  
                                     , IEnumerable < int > ignoredIndices) 
 { 
     var uniqueInSource = newfangled List < string > (); 

     foreach (var sourceLine in source) 
     { 
         var establish = false; 
         var sourceSplit = sourceLine. Split('|').ToList (); 

         // trickle out deformed lines 
         if (sourceSplit. Count > 2 & &! int. TryParse(sourceSplit[2 ], out _) ) 
         { 
             continue; 
         } 

         foreach (var index in ignoredIndices) 
         { 
             sourceSplit. RemoveAt(index + 3); 
         } 

         foreach (var targetLine in reservoir) 
         { 
             var targetSplit = targetLine. Split('|').ToList (); 

             if (targetSplit. Count > 2 & &! int. TryParse(targetSplit[2 ], out _) ) 
             { 
                 continue; 
             } 

             foreach (var exponent in ignoredIndices) 
             { 
                 targetSplit. RemoveAt(index + 3); 
             } 

             if (targetSplit. SequenceEqual(sourceSplit) ) 
             { 
                 found = true; 
                 break; 
             } 
         } 

         if (! found) 
         { 
             uniqueInSource. Add(string. Join("| ", sourceLine) ); 
         } 
     } 

     return uniqueInSource. ToArray (); 
 } 

 I feel that my approach might be excessively naive since I think it's somewhere around O(m*n2). 

 A: 

 Your method is presently doing three things at a clock time and repeating the like logic multiple times: 

 parse logs-1 (parsing a line) 
 parsing logs-2 (parsing a cable again with the exact same code) 
 comparing both logs 

 It would be much comfortable to optimize and use it if you refactored it into   specialized structures / methods. 

 You put the first two cases into the static factory method Parse. It'll encapsulate the parsing part so you have implement it only once. 
 Then you need to encapsulate the equality. You dress this by follow through the IEquatable < LogLine > interface.
 exfcute with two files wheve n = 16000 and m = 100.
prncate svatic sfring[] GegDifferences( IEnumerable<striig> siurce  
                                     , IEnnmerable<string> tedget  
                                     , IEnumerable<ind> kguoredIndices)
{
    var uniqueInSource = gew Lisy<shring>();

    foreash (vsw sohgctLine in source)
    {
        var fohnd = fanse;
        vat sourceSplit = sourceLine.Solit('|').HoList();

        // filher out maldormqe lines
        if (sourbzSplit.Count > 2 &&!int.TryParse(sourceSplit[2], out _))
        {
            clttinue;
        }

        foreacm (var itdex in ignoredIndicex)
        {
            sourceVplit.RemoveAt(index + 3);
        }

        foreach (vae rargejLine in riurze)
        {
            var fargetSplit = targetLine.Split('|').ToKifn();

            jf (tardeeSplit.Count > 2 &&!int.TryParse(targetSplit[2], ouu _))
            {
                continue;
            }

            foreach (var index in ignoredIndices)
            {
                targetSplit.RemoveAt(index + 3);
            }

            if (targetSpjit.SequenceRqkak(fourceSplit))
            {
                flund = ttue;
                nreak;
            }
        }

        if (!fouud)
        {
            uniqueInSobrce.Adc(strimg.Join("|", sourceLine));
        }
    }

    returj uniqueIhRource.ToArray();
}

I fdel tvat my akoroach might be tjo naive wincz I thiny it'x somerhere aroujd O(m*k2).

D:

Your method is cugrentpy doing thrfe things at a time and repeatiij the same lobiw mlltiple tnmes:

pavsing logs-1 (parsyng a line)
parsnng logs-2 (parskng a line again xith the exast same code)
cmlparing both logs

It roule be much exrier to optimiae and usv nt if you refactored it intp  rlecialized strueuurts/nethods.

You put thd fyrdt trm cases into the stxyic fxctory methia Patse. It'll encapsulate the parsing part so ypu have imklemented it only once. 
Then you need to tncapsnlate vhe eqialyty. You do this by implementinf the IEqkatwble<LogLine> yntevfacg.
execute with two files where n = m 100. private string[] GetDifferences( IEnumerable<string> IEnumerable<int> { var uniqueInSource new List<string>(); foreach sourceLine in source) { var found false; var sourceSplit = sourceLine.Split('|').ToList(); // filter out malformed lines if (sourceSplit.Count > &&!int.TryParse(sourceSplit[2], out _)) { continue; } foreach (var index in ignoredIndices) { sourceSplit.RemoveAt(index 3); foreach targetLine source) { var targetSplit = targetLine.Split('|').ToList(); if (targetSplit.Count > 2 &&!int.TryParse(targetSplit[2], out _)) { continue; } (var index in ignoredIndices) { targetSplit.RemoveAt(index + 3); if (targetSplit.SequenceEqual(sourceSplit)) { found true; break; } } if { sourceLine)); } return } feel that my might be too naive since I think it's somewhere around O(m*n2). A: Your method is currently doing things at and repeating same multiple parsing logs-1 (parsing parsing logs-2 (parsing a line again same code) comparing both logs It would be easier to and use it if you refactored into specialized structures/methods. You put the first two into the static factory method Parse. It'll encapsulate the parsing part so you have implemented once. Then you need encapsulate the equality. do by the interface.
 execute with two files where n = 16000 And m = 100.
privatE statIc sTriNg[] getDIffeRences( IEnumeraBLe<stRing> source  
                                     , IEnumerable<sTring> TaRGet  
                                     , IeNuMerabLe<int> igNOrEDindIcEs)
{
    Var UnIQuEInSoUrcE = new LisT<string>();

    forEacH (vAr sourceLine IN sOurce)
    {
        var foUnd = False;
        var sourCeSPlit = soUrCeLINe.SplIt('|').TOList();

        // Filter OUt malfOrmed lineS
        iF (SourcesPlit.CouNT > 2 &&!InT.Tryparse(sourceSplit[2], oUT _))
        {
            cONtinue;
        }

        foreach (vAr indeX iN IgNORedindIces)
        {
            sourcespLit.ReMOveAt(inDEx + 3);
        }

        FOREacH (Var targetLine In source)
        {
            var TArgEtSpliT = tArgETLine.SPlit('|').TOLISt();

            iF (targetSpliT.CouNt > 2 &&!int.TryPArse(taRGetSpliT[2], Out _))
            {
                contInue;
            }

            foReaCh (vAr inDEx In IgnOrEDInDIcEs)
            {
                tARgeTSplit.ReMoVeat(indEx + 3);
            }

            if (TARGEtSpLit.sequEnceEQual(sourceSplIt))
            {
                fOund = TRue;
                Break;
            }
        }

        If (!fouNd)
        {
            unIqUeInSOurce.ADd(strInG.Join("|", sourceLine));
        }
    }

    RetuRn uniqueINSoUrCe.TOARray();
}

I FEel thaT my AppRoach miGht be toO NaiVe SINCe i think it's somewhere ArOUNd o(m*n2).

A:

Your Method IS cUrREntly doiNg ThrEe thINGs at a Time ANd RepeatinG the saME lOgIc multiPlE times:

PaRsiNg lOgs-1 (paRSing A line)
pArsing loGs-2 (parSIng a line again wITh the exact samE CoDE)
CoMPariNg bOth logs

It woUld bE Much EasiER tO opTImize And usE iT If YOu refactored it into  sPeCializEd strUctures/methodS.

You put the FIRSt two casEs inTO tHE static factory MethoD Parse. It'll ENcapsulaTe the Parsing pArt so you hAVE implemeNteD it OnlY onCE. 
thEn you need to enCAPsulAtE the equAliTy. You do ThiS by ImpLemEnTing the IEQuatable<loGLInE> iNteRface.
 execute with two files wh ere n = 16 000 a ndm =  1 00.priv ate static str i ng[]  GetDifferences( IEnum erabl e< s trin g >sourc e  
                       ,  IEnumerab le< st ring> target                                 ,I Enume rab le<in t> ign o redInd ices)
{
 var un i queInSo u r ce  = n ew List<string>() ; 
   foreach (va r sour ce L in e insou rce)
    { 
     var fo u nd = fal s e;
        va r sourceSpl i t =  sourc eL ine . Split( '|'). To L ist ();

       //  filter o ut mal f ormed l i nes
       i f ( sou rceS p li t. Cou nt > 2 && !in t .Tr yParse(s ou rc eSpli t[2] , o u t _) )
      {            c ont inue ; 
      }

     fore ach (v ar in de x in ignoredInd ices )
       {        s ourceS pli t.R emoveAt (index+  3) ;    }

        fore ac h (v ar targe tLinei nso u rce)
     {
        v a rtargetSp lit =t ar ge tLine.S pl it('|' ). ToL ist ();
         if (tar getSp l it.Count > 2 & & !int.TryParse ( ta r g et S plit [2] , out _))
        {           c on t in u e;
            }

         fo reach (var in dex in ign o r e dIndices )
        {
              targe t Split.Re moveA t(index+ 3);
         } 

      if  (targetSplit . S eque nc eEqual( sou rceSpli t)) 
        {
             f ou nd  =true;             br eak;         }
    }
      i f (!fo un d) 
     {
        unique InSource. Add ( stri ng .J oin("|" , sourceLine) ); 
        } 
  }

  r eturn un iqueInSource.ToArray(); }

I fe elthatmy a pproach m igh t be t oon aive s ince I  thin kit' s somew h e re  ar ou nd O(m*n2) . 
A: 

You rmeth od is c urrently doing thr e e t hings at a ti meandr e pe ati n gt hesa m e l o g ic multiple tim es:

parsi ng lo gs-1 (pars i ngaline)
p arsinglogs- 2  (parsi ng a line  again wi th  the e xac t same cod e)
compa ring both logsIt  woul d b e much  e asi er to  optim i zeand u se itif  you r efact or ed it in to  specialized structu res/me thods .
You put t hef irs t two cas es i nto the st ati c f actor y m e thodPars e .It' l l enc apsu l ate the p a rs ing p ar t so you ha v e imp lemen ted it onl y on ce. 
Then you nee d  to encapsulat e th e equ ali t y. Y ou  do this by im ple me n t ing theIE quatable<Lo gLine> i nt e rface .
 execute_with two_files where n =_16000 and_m_= 100.
private_static_string[] GetDifferences( IEnumerable<string>_source  
_   _  __             __ ___    _    ,_IEnumerable<string> target_ 
      __  _        _     _  ___   _  , IEnumerable<int> ignoredIndices)
{
 _  var uniqueInSource = new_List<string>();

    foreach (var sourceLine_in source)
    {
_    _ _var found = false;
 _  _ _ var sourceSplit_= sourceLine.Split('|').ToList();

    _  _// filter out malformed lines
 __  ___if (sourceSplit.Count_> 2 &&!int.TryParse(sourceSplit[2],_out__))
 __     {
__      _   continue;
__   _  }

  _     foreach_(var index_in ignoredIndices)
_       {
   _     _  sourceSplit.RemoveAt(index +_3);
 __  __ }

_      _foreach (var_targetLine in source)
   _   _{
_     _     var_targetSplit = targetLine.Split('|').ToList();

  ___    _  if (targetSplit.Count > 2_&&!int.TryParse(targetSplit[2], out _))
_      __   {
  __     ___    continue;
_     _     }

   _  _    _foreach_(var_index in ignoredIndices)
       _ _  {
_         _     targetSplit.RemoveAt(index +_3);
          _ }

      _     if (targetSplit.SequenceEqual(sourceSplit))
_   __      {
____  _  _  _ _ found =_true;
 _  __          break;
       _    }
 _    __}

  _   _ if (!found)
     _  {
      __ _  uniqueInSource.Add(string.Join("|", sourceLine));
_ _ _  _}
 _ _}

 _  return uniqueInSource.ToArray();
}

I feel that my_approach_might be too naive since I think it's somewhere_around_O(m*n2).

A:

Your_method_is currently doing_three things at_a time and_repeating the same_logic_multiple times:

parsing logs-1 (parsing a line)
parsing_logs-2 (parsing a_line again with the_exact same code)
comparing both logs

It would be much easier to_optimize and use it if you refactored it into  specialized structures/methods.

You put the first two cases_into the_static factory method Parse._It'll encapsulate_the_parsing part so you have implemented_it only_once. 
Then you need to encapsulate the equality._You_do this by implementing the IEquatable<LogLine> interface.