I have created a lot of custom CSV importers for WordPress in the past and I have come across issues related to the time it takes for them to finish processing.
Whenever the importer starts running, it starts off importing a lot of posts per second but this speed keeps decreasing and I am trying to figure out the reason for this and if whether there is something that I can do to speed up things.
Some importers I create import up to 100k entries.
This is how they work:
- Load rows from CSV file into an array
- Get row from arrow
- Create a post using this row
- Add meta values to this post from the row
- Go back to #2
In some cases I have observed these importers to import as many as 200 entries in a few seconds when they are launch and this comes down to around 5 to 10 in a few seconds.
Does anyone know what the reason for this could be and if whether there is something that can be done about it?