I am downloading a json file that countain 5000 objects. This is done in 10 seconds, but when i am trying to save all those elements in my database, that take a huge time, more than 5 minutes.
Did any one face this problem? any explanation, why it take all this time? How can i fix this problem?
I used this answer to fix my problem:
https://stackoverflow.com/a/3501572/833219
Try to use transactions to do multiple inserts.
You can only do very few commits per second but lots of inserts per transaction.
http://www.sqlite.org/faq.html#q19