fix repeated injection of expensive operations in krun

@yilongli please review