Optimizing TaskQueue operations