How to make 4 pin OLED display run faster

KonoDioDa:
Thanks for all the replies :). I used olikraus' solution, and it now works, but inconsistently. It works sometimes, but other times it misses the beam break or only one of them triggers. Is there a way to make it even faster? ....

To make it faster - maybe don't use Arduino framework but native code support for this particular project.
What board are you using?