We report on the switching of an all-optical flip-flop consisting of a semiconductor optical amplifier (SOA) and a distributed feedback laser diode (DFB), bidirectionally coupled to each other. Both simulation and experimental results are presented. Switching times as low as 50ps, minimal required switch pulse energies below lpJ and a repetition rate of 1.25GHz have been measured. Contrast ratios over 25dB have been obtained. The dependence on the pulse length and CW input power of the minimal required switch energy is investigated.