Gut bacteria respond quickest to sudden changes of optimum size in surrounding environment