Deleting child with lots of fields causes 10+ seconds of lag
I believe the culprit here is https://github.com/theatlantic/django-nested-admin/blob/de440b1333eeb9bd85ca412d717d0e89652207e7/nested_admin/static/nested_admin/src/nested-admin/jquery.djangoformset.js#L137 as it is referenced a lot when I profile the performance.
https://stackoverflow.com/a/9180541 suggests that doing .html('') before the .remove() will increase performance dramatically. Haven't tested this, but will do once I have time.
Did some minified file editing. Turns out jQuery is extremely slow for anything related to clearing out the inline form. The following gives the same amount of lag:
$form.html(""); // no change
self.remove($form);
The following, however, works:
$form[0].innerHTML = ""; // native DOM is superfast
self.remove($form);
Will send in a PR soon.
To be on the safe side, if you're going to change that, it ought to be in the DjangoFormset .remove() method itself, before this line: https://github.com/theatlantic/django-nested-admin/blob/de440b1333eeb9bd85ca412d717d0e89652207e7/nested_admin/static/nested_admin/src/nested-admin/jquery.djangoformset.js#L166
Will do.