On one of our PW sites, we are importing data from an external API into the processwire database.
The import contains around 450 "Objects" and on average each of these objects has around 20 sub-objects.
This means I am creating around 9,500 pages during the initial full import (subsequent imports only make amends and additions)
The problem here is I seem to be hitting the php memory limit.
I have already upped it to 256Mb, and don't really want to up it further.
I just want to share my findings from today when I wanted to create one million pages quickly:
First, via Tracy Console:
$last = $pages->findOne("parent=/data,include=all,sort=-id");
$last = (int)$last->title ?: 0;
// create page
$p = new Page();
$p->template = 'basic-page';
$p->parent = '/data';
$p->title = $i;
l("saved page $i");