in_array performance in unsorted vs sorted array



I am reading transaction records from files. Each record has an alphanumeric GUID but that record may be repeated in more than one file (because of overlapping samples). I don't want to process duplicate records, so I am considering a simple flat file to store the GUID's of previously processed records.

To keep things simple I plan to use $done=file() to read the flat file, and a simple if in_array to see if the current GUID has already been processed, if not process the current record and add its GUID to $done.

Does anyone know if sorting an array has any significant impact on in_array, or can I simply push push values into $done?

Also is there a better way than foreach() write() to get $done back into the flat file?

.



Relevant Pages

  • Re: Passing in properties using the Submit adapter
    ... > I have a web service that recieves a Flat File, ... > passed in as a string) and a database index value. ... > ID GUID"); ... you're passing the XSD namespace instead! ...
    (microsoft.public.biztalk.general)
  • Re: in_array performance in unsorted vs sorted array
    ... alphanumeric GUID but that record may be repeated in more than one file ... To keep things simple I plan to use $done=fileto read the flat file, ... Also is there a better way than foreach() writeto get $done back into ... So I suspect it makes no difference on whether the array is sorted or not. ...
    (comp.lang.php)
  • Passing in properties using the Submit adapter
    ... I have a web service that recieves a Flat File, a user id (A guid ... BTS so that I can use them in the orchestration. ...
    (microsoft.public.biztalk.general)
  • Re: in_array performance in unsorted vs sorted array
    ... alphanumeric GUID but that record may be repeated in more than one file ...  I don't want to process duplicate ... To keep things simple I plan to use $done=fileto read the flat file, ... or can I simply push push values into $done? ...
    (comp.lang.php)