Great change. A quick run on my benchmark seem to show a 15% performance improvement as a result of this for me... of course your mileage may vary.
A further optimization could be to analyze the modifications and/or undo-ops *before* PREPARE/ROLLBACK, and to actually optimize them, e.g.
could be coerced into
Maybe we should create a JIRA issue for this...