I currently code in PHP. Recently I've been working on a project using PHP and Symfony that:
- reads large XML files (lots of DOM parsing/reading),
- converts large XML files to large arrays,
- merges 2 large arrays (lots of array sorting),
- takes the 2 large arrays and turns them into a large CSV file.
I finished it in PHP but now it is kind of memory intensive and requires about 8-15 seconds to run. So now I have the following options and need help choosing one:
- Try rewriting/refactoring it using better methods in PHP
- Choose a different programming language (I have been wanting to learn one, possibly another language processes these things a lot faster?)
- Do 1 or 2 and additionally set up something to be constantly reading xml files and write them to MongoDB documents to serve clients from the database instead of scrapping the data.
I am inclined to do 2 or 3 (using a different language), since I am sure there is another language that handles these kind of tasks much faster (e.g Python, C etc.). It's just that I am not sure which.