0

I wondering is there a difference in speed between reading\putting data from 1 XML file with 10 items and 10 files with 1 item per each?

I'm developing a small CMS now, so the question about storing data for some plugin.

Thank you

Andrew Bro
  • 471
  • 2
  • 6
  • 20
  • XML is literally made for storing data – Cârnăciov Feb 27 '16 at 16:54
  • 10 vs 1? Probably no. 1000000 vs 1? Probably yes. – Matti Virkkunen Feb 27 '16 at 16:54
  • @aron9forever but that is not the question –  Feb 27 '16 at 16:56
  • @LPK alright, then the answer is obviously one file is faster, because you don't have to open, handle and close 10 times to process the same amount of data. – Cârnăciov Feb 27 '16 at 16:57
  • 1
    OP, you can do a benchmark yourself, use the code from http://stackoverflow.com/questions/535020/tracking-the-script-execution-time-in-php, not the answer but the one below it with `microtime()`. Write a script to open, read, write and close 10 files, then do the same thing to one file with 10x the data, and loop it a high enough number of times to notice a difference. – Cârnăciov Feb 27 '16 at 17:00

0 Answers0