Comment 5 for bug 1974105

Revision history for this message
Leonard Richardson (leonardr) wrote : Re: slow performance within Tag.index(child)

As you can tell, Beautiful Soup wasn't designed for tree manipulation and I've never seriously used it that way. If I could recommend another solution I would, but I don't know of anything other than jQuery (where the "unwrap" idea comes from).

Insofar as it's possible, implementing these operations the way they're implemented in jQuery might help. But after looking at the jQuery source I see that the Javascript functions quickly call out to DOM methods which may well be backed by a well-tested cache of element locations.

If you want to share the test generation code, yes, that could be used as a fuzzer.