Minimizing delay and power consumption at the edge