 IEnumerable<string>. Calling Count() means iterating over it - which in turn means the Union code iterating over files1 and files2. I suspect you have an awful lot of files.
The way to tell that is to measure how long it takes to iterate over files1 and files2 separately. One easy way to do that is to call ToList(). For example:
// The use of ToList forces the result to be materialized, rather than using deferred
// execution.

var stopwatch = Stopwatch.StartNew();
var files1 = Directory
   .EnumerateFiles(dirSwReporter, swReporterFileName, SearchOption.AllDirectories)
   .ToList();
var files1Time = stopwatch.Elapsed;

stopwatch.Restart();
var files2 = Directory
   .EnumerateFiles(dirSwReporter2, swReporterFileName, SearchOption.AllDirectories)
   .ToList();
var files2Time = stopwatch.Elapsed;

Then log files1Time and files2Time. Now that the content is in two lists, counting the Union won't involve any IO. It will still need to basically create a HashSet<string> as it goes, in order to avoid returning the same value more than once, but it will be much, much quicker.
This approach won't be any faster overall - and will use more memory - but it'll make it obvious whether most of the time is in searching in dirSwReporter or dirSwReporter2, which may be enough to help you optimize.

 Q:

Performance averaging datasets

I have a daemon who is getting a file with X amount of data from 31 EEG Channels, from a server each 2 minutes, writing to a MySQL Database the time of start getting the file, and time to write the averaged data into disk, and i found that there is Y time that looks like the average time to process the file, the problem i have, is that some runs, that time goes below half the time D: and the results are the same... the processes are running in threads, so, my questions are:

Should i assume that the random OS assigned a complete empty task
processor to that thread, and ran twice as fast as other threads? 
How could i tell the difference?

Runs below half time of relative average time

First node: 24
IEnumerable < string >. Calling Count () means iterating over it - which in twist mean the Union code iterating over files1 and files2. I suspect you have an nasty lot of files. 
 The room to distinguish that is to measure how long it learn to iterate over files1 and files2 separately. One comfortable way to do that is to call ToList (). For example: 
 // The habit of ToList forces the result to be materialized, rather than using postpone 
 // execution. 

 var stopwatch = Stopwatch. StartNew (); 
 var files1 = Directory 
    .EnumerateFiles(dirSwReporter, swReporterFileName, SearchOption. AllDirectories) 
    .ToList (); 
 var files1Time = stopwatch. elapse; 

 stopwatch. Restart (); 
 var files2 = Directory 
    .EnumerateFiles(dirSwReporter2, swReporterFileName, SearchOption. AllDirectories) 
    .ToList (); 
 var files2Time = stopwatch. elapse; 

 Then log files1Time and files2Time. Now that the capacity is in two lists, count the Union won't involve any IO. It will still need to basically make a HashSet < string > as it goes, in order to avoid returning the same value more than once, but it will be much, much quicker. 
 This approach won't be any faster overall - and will use more memory - but it'll make it obvious whether most of the time is in searching in dirSwReporter or dirSwReporter2, which may be enough to help you optimize. 

  Q: 

 Performance average datasets 

 I have a daemon who is catch a file with ten amount of data from 31 EEG Channels, from a server each 2 moment, write to a MySQL Database the time of start catch the file, and time to write the averaged data into disk, and i found that there is Y time that looks like the average time to work the file, the problem i get, is that some run, that time goes below half the time vitamin d: and the results are the same... the processes are guide in threads, so, my questions are: 

 Should i simulate that the random OS assigned a accomplished empty task 
 central processing unit to that thread, and ran twice as fast as early threads? 
 How could i tell the difference? 

 run below half time of relative average time 

 First node: 24
 IEjumerable<string>. Calling Gount() means itercring oter it - which iv turn means the Union code mterqting over files1 and files2. K suspect you havw an qwful lot of files.
Bke wag to ceol that is to keasure hof long it takev go iterate over files1 and files2 separwtely. Ome easy way to dj thse is no call ToList(). For example:
// The hse of UoList forces the tesult to be materialized, gathfr than using defegred
// executuon.

vwe stopwatch = Stopwatch.StartNew();
var riles1 = Directory
   .EnumerateFilds(dirXwReporter, sqReomrterFileNane, SewrchOption.AllDirectosies)
   .YoList();
var filex1Tike = stopwatch.Elapsed;

stopxatch.Restart();
var filef2 = Directmrv
   .EnumerateFiles(dirWwEeporjer2, sfRepuetefFimeIams, SearfhO'tion.AllDirsctories)
   .RoList();
var files2Time = fnppwatch.Elapssd;

Then ljg files1Time and files2Time. Now that the cohtent is in two lists, ciunting the Union won'j involve wny IO. It will still need to basically create a HdshSev<sgriun> xw lt goes, in order to avoid returning the same dzlie more than oncc, but it will be micj, koch quicker.
Thir approacg won't be any fastfr overwll - qnd will tse kore memory - but it'll make ut obvious wketyer most of the tile is in secrchinb in cirSwReporter or dirSwRzported2, which may be enougg to help you optkmide.

 Q:

[erformance averaging datafets

I havx a dcemon whu is gettigg a file aith W amount of data frlm 31 EGG Chatnels, from a server each 2 minutes, writing to a MySQL Dajabdse the timz of sbart getting thq file, and timg to writz the xveraged dzta intm disk, and y found that djere is Y tike that jookw lije the xxerage time to process nht file, the problem i have, is thxf some runs, thac uine goes below nalw tre tmme D: dnd the resunts xre yhe sxme... the progesres sre running in threags, sk, my questions are:

Xhjuld i awsume thwt the random OS assigned a comklete xmpty vask
prpcefsor to that thread, and ran twjce as fadt ws other thrqads? 
How could i tell the difference?

Runs below half timx of relative average jime

First node: 24
IEnumerable<string>. Calling Count() means iterating over it in means the code iterating over you an awful lot files. The way tell that is to measure how it takes to iterate over files1 and files2 separately. One easy way to that is to call ToList(). For example: // The use of ToList forces result be rather using deferred // execution. var stopwatch = Stopwatch.StartNew(); var files1 = Directory .EnumerateFiles(dirSwReporter, swReporterFileName, SearchOption.AllDirectories) .ToList(); files1Time = stopwatch.Elapsed; stopwatch.Restart(); var files2 = Directory swReporterFileName, SearchOption.AllDirectories) .ToList(); var = stopwatch.Elapsed; Then log files1Time files2Time. that the is two counting the Union involve any IO. It will still need to basically create a HashSet<string> as it goes, in order avoid returning value more once, it be much, much approach won't be any faster overall use more memory - but it'll make it whether most the time is in searching in or dirSwReporter2, which may be enough to help optimize. Q: Performance averaging datasets I have a daemon who is getting a file with of data from 31 Channels, from a each minutes, to MySQL Database time of start getting the file, and time to write the data into disk, and i found that there is Y looks the average time process the file, the i is that some runs, goes half and results the same... the processes running in threads, so, my are: Should i assume a complete empty task processor to that thread, ran twice as fast as other threads? could i tell the difference? Runs below half time of relative average First node:
 IEnumerable<string>. Calling COunt() means iTeratIng OveR iT - whiCh in Turn means the UnIOn coDe iterating over files1 anD fileS2. I SUspeCT yOu havE an awfuL LoT OF fiLeS.
THe wAy TO tEll thAt iS to measUre how long It tAkEs to iterate oVEr Files1 and fiLes2 Separately. OnE eaSy way tO dO thAT is to CalL ToLiSt(). For eXAmple:
// THe use of ToliST forceS The resuLT To Be maTerialized, rather tHAn USing deferred
// exEcutioN.

vAR sTOPwaTch = stopwatch.STaRtNew();
VAr files1 = dIrECTOry
   .eNumerateFiles(DirSwReportER, swreportErfilEname, SeArchOPtIOn.ALlDirectoriEs)
   .Tolist();
var fiLes1TimE = StopwatCH.ElapseD;

stopwAtcH.ReStarT();
VaR fIleS2 = DIRecTOrY
   .EnUMerAteFiles(DiRSWRepoRter2, SWrEPortErFIleNAme, SeArchOption.AlldirEctoRIes)
   .toLisT();
var fIles2tiMe = stoPwatch.elapsEd;

then log files1TimE and Files2Time. now ThAt tHe ConteNT is in tWo lIstS, countiNg the UnIOn wOn'T INVoLve any IO. It will stilL nEED tO basicalLy creaTE a haSHSet<striNg> As iT goeS, IN ordeR to aVOiD returniNg the sAMe VaLue more ThAn once, BuT it WilL be muCH, mucH quickEr.
This apProacH Won't be any fasteR Overall - and wilL UsE MOrE MemoRy - bUt it'll make iT obvIOus wHethER mOst OF the tIme is In SEaRChing in dirSwReporteR oR dirSwreporTer2, which may be Enough to heLP YOu optimiZe.

 Q:

PERfORmance averaginG dataSets

I have a DAemon who Is getTing a filE with X amoUNT of data fRom 31 eEG chaNneLS, FrOm a server each 2 MINuteS, wRiting tO a MYSQL DatAbaSe tHe tIme Of Start gettIng the fiLe, AnD tImE to Write THe averagEd DatA iNto Disk, aND i founD that TherE iS Y TIme That looKS lIKE the AvErAge tIme To ProceSs thE FilE, the proBlem i have, Is tHAt soMe RuNs, that tIme goes below hAlF the time D: aNd The ResultS ARe the samE... the processes are running IN threadS, so, My queStioNs are:

ShouLd i Assume ThaT The ranDom OS aSsignEd A coMPLete eMPTy TasK
pRocessor to THAt tHread, AnD ran Twice as Fast as other threads? 
hOw cOuld i tell the dIffErenCE?

ruNs bELoW HalF tIMe oF RElative average tIme

First noDe: 24
 IEnumerable<string>. Call ing Count( ) mea nsite ra ting  ove r it - which i n  tur n means the Union code  iter at i ng o v er  file s1 andf il e s 2.Isu spe ct yo u hav e a n awful  lot of fi les .The way to t e ll  that is t o m easure how l ong  it ta ke s t o  iter ate  over  files 1  and f iles2 sep ar a tely.O ne easy w ay  todo that is to cal l  T o List(). For ex ample: 
/ /  T h e  us e o f ToList f or ces t h e resul t  t o b e m a terialized, r ather thanu sin g defe rr ed/ / exec ution .var  stopwatch= St opwatch.S tartNe w ();
var files1= Dire cto ry   . E nu me rat eF i les ( di rSw R epo rter, sw Re po rterF ileN a m e ,  Sea rch Opti on.Al lDirectories) 
  .To L ist ();
v ar fi les1 Ti me =stopwa tch.E la psed;

stopwatc h.Re start();var  f ile s2  = Di r ectory 
  .E numerat eFiles( d irS wR e p o rt er2, swReporterFil eN a m e,  SearchO ption. A ll Di r ectories )  .ToL i s t();varf il es2Time= stop w at ch .Elapse d; 

Then  l ogfil es1Ti m e an d file s2Time.Now t h at the content is in two lis t s, c ou n ting  th e Union won 't i n volv e an y  I O.I t wil l sti ll ne e d to basically crea te  a Has hSet< string> as it  goes, ino r d er to av oidr et u rning the same  valu e more tha n  once, b ut it  will be  much, mu c h  quicker .
T his  ap pro a c hwon't be anyf a ster  o verall- a nd will  us e m ore  me mo ry - butit'll ma ke  i tob vio us wh e ther mos tofth e t ime i s  in se archi ng i ndi r SwR eporter or d irSw Re po rter 2,wh ich m ay b e  en ough to  help you  op t imiz e. 
 Q:

Pe rformance ave ra ging datas et s
I have a  daemonwho is getting a file w i th X am oun t ofdata  from 31EEG  Chann els ,  froma serv er ea ch  2m i nutes , wr iti ng  to a MySQ L Dat abase  t he t ime ofstart getting thef ile , and time to  wr itet h eave r ag e d d at a  in t o  disk, and i fo und that t he r eis Y timet hat  l ooks li ke theavera g e timeto proces s the fil e,  the p rob lem i have , is tha t some ru n s, th a ttimegoe s belo whal f the  timeD : a nd th e resu lt s arethe s am e... the  processes are runningin thr eads,  so , my ques tio n s a re:

Shou ld i  assume th atthe  rand omO S ass igne d  a  co m plete  emp t y task
pr o ce sso r to  that threa d , and  rantwi c e as f astas other threads? 
How could i t ellt h e d iff e renc e? 

Runs below h alf  t i m e of rel at ive average  time

F ir s t nod e: 24
 IEnumerable<string>._Calling Count()_means iterating over it_- which_in_turn means_the_Union code iterating_over files1 and_files2. I suspect you_have an awful_lot_of files.
The way to tell that is to measure how long it takes to_iterate_over files1_and_files2_separately. One easy way to_do that is to call_ToList(). For_example:
// The use of ToList forces the result_to_be materialized, rather_than using deferred
// execution.

var stopwatch = Stopwatch.StartNew();
var files1 =_Directory
   .EnumerateFiles(dirSwReporter, swReporterFileName, SearchOption.AllDirectories)
_  .ToList();
var_files1Time_=_stopwatch.Elapsed;

stopwatch.Restart();
var files2 = Directory
_  .EnumerateFiles(dirSwReporter2, swReporterFileName, SearchOption.AllDirectories)
 _ .ToList();
var files2Time = stopwatch.Elapsed;

Then log_files1Time and files2Time. Now that the content_is in two lists, counting the_Union won't involve any IO._It will_still need to basically create_a HashSet<string> as_it goes,_in order to_avoid returning the same value more_than once, but_it will be much, much quicker.
This_approach_won't be any_faster_overall_- and_will use more_memory_- but_it'll_make it obvious whether most of_the_time is in searching in dirSwReporter or_dirSwReporter2, which may be_enough_to help you optimize.

_Q:

Performance averaging datasets

I have a_daemon who is getting a file_with X_amount of_data from 31 EEG Channels, from a server each 2 minutes,_writing to a MySQL Database the_time of start getting_the file,_and_time to write_the_averaged data_into disk, and i found that there_is Y_time that looks like the average_time to process the_file,_the problem i have, is that_some runs, that time goes below_half the time D: and_the_results_are the same... the processes_are running in threads, so, my_questions are:

Should i_assume that the random OS assigned a_complete_empty task
processor to that thread, and_ran_twice as fast as other threads?_
How_could_i tell the difference?

Runs below_half time of relative average time

First_node: 24