The short question is I am looking for the most efficient way to compare two data structure arrays, I currently having it working with loops but it takes a couple of minutes to run and it seems like there is a better way.
The long explanation why. The process I have is to compare two files that have a totally different structure, our old order format(file described and out of date) and our new one(shiny new sql table). Before switching I need to run these comparisons for a couple of weeks and make sure that the conversions are taking place properly and there aren't any discrepancies between the two files. There aren't any rules for these files just a bunch of records with store, item, qty in them so I figured the easiest and most bullet proof way was to read the two files into data structures defined just like that and then compare the two and blank out matching records. When I get to the end all that is left is ones that have not matched. I just read through the structures one more time and print them out. It seems to work just want to try and make it a little faster.
The long explanation why. The process I have is to compare two files that have a totally different structure, our old order format(file described and out of date) and our new one(shiny new sql table). Before switching I need to run these comparisons for a couple of weeks and make sure that the conversions are taking place properly and there aren't any discrepancies between the two files. There aren't any rules for these files just a bunch of records with store, item, qty in them so I figured the easiest and most bullet proof way was to read the two files into data structures defined just like that and then compare the two and blank out matching records. When I get to the end all that is left is ones that have not matched. I just read through the structures one more time and print them out. It seems to work just want to try and make it a little faster.





Comment