fragment deletion event is slow: it takes 1.5 seconds or more on detach on large apps
While adding function tracing to drcachesim (#3048 (closed)) I was consistently seeing a big slowdown on detach: it used to take 0.3s to detach from 600-ish threads and fully clean up DR, but with function tracing it suddenly took 1.7s. I tracked it down to just initializing drwrap, even without wrapping anything! It turns out it's the fragment delete event. If it's enabled, at cleanup DR walks every fragment (500K for this app's attach-detach window), does individual cleanup, and calls the client callback.
For now I'm removing the drwrap event as it happens to not be necessary.
For the future we should try to remove all the individual fragment deletion work and limit it to only calling the client callback, which should shrink the time taken.