04.03.2014, 23:27
What do you even expect with 13 large loops? Over 4000 lines have to be written. Writing to disk is extremely slow by its very nature. I would suggest rethinking your whole structure, possibly moving it to SQLite or MySQL. These are specifically created to handle large amounts of data. It's not going to get any faster than this if you stick to pure disk writing.