0

I am creating a Magento Import extension for parsing XML file generated by one of our ERP software. The file can have more than 1M record. I want to parse the XML to fetch product details and add it to magento database. I have used Varien_Simplexml_Config method to read XML but reading at some article I found the SimpleXml will degrade performance with large files as it load entire tree into memory.

Does anyone has any better solution? Please advice.

Elixir Techne
  • 1,848
  • 15
  • 20

1 Answers1

1

That is a lot of rows, I would suggest using Magmi (http://wiki.magmi.org/) by first converting the XML -> CSV or using Magmi Datapump API.

XMLReader api using streams should be better either way, as it does not load the full XML into memory at once, see this post for more: https://stackoverflow.com/a/911674/653721

Community
  • 1
  • 1
Christoffer Bubach
  • 1,676
  • 3
  • 17
  • 45