Slow insertion of objects having lots of relations
When calling putDataObjects with objects having relations, those relations are inserted one by one to do an upsert. Unfortunately when the number of relations is high (sometimes several thousands) this is extremely slow (around 35s for 14000 relations).
Upserting in bulk sql commands (say, 50 at a time) reduces that time to 1.5s. Grouping further still improves performances by a marginal amount. But doing that needs to account for this as well: Multiple on conflict targets.