speed up log_ui_from_prev