Question

I currently code in PHP. Recently I've been working on a project using PHP and Symfony that:

  1. reads large XML files (lots of DOM parsing/reading),
  2. converts large XML files to large arrays,
  3. merges 2 large arrays (lots of array sorting),
  4. 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:

  1. Try rewriting/refactoring it using better methods in PHP
  2. Choose a different programming language (I have been wanting to learn one, possibly another language processes these things a lot faster?)
  3. 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.

No correct solution

Licensed under: CC-BY-SA with attribution
scroll top