Thanks for the thorough explanations!
Yes, there are multiple G1 commands between M3 and M5.
However, I think I noticed that with slower speeds my paths are "more complete" - I have to make more tests about that.
I think the picture was taken with 6mm/s.
My initial tests were with 50mm/s where basically non of the paths were cut correctly. Only a few dots, likey beginnings/ends of paths…
My 2.5W laser diode is powered from the PCB that came with it - a bunch of ICs, DC-DC step down convertes, and an op-amp. The "datasheet" says 0-5V TTL, which I connected to HEATER_3.
The power input for the laser PCB is a 12V DC-DC converter that is fed by my 24V PSU.
The laser fan (12V presumably) is connected to the laser PCB, and is always on. So there is always a small load on the 24V->12V converter.
I will do more test patterns, and maybe add a big electrolytic cap on the buck converter.
edit:
I used http://jherrm.com/gcode-viewer/ to simulate my gcode - and I think the incomplete paths are from the beginning, i.e. The laser is turned on too late (or reaches full power too late). This results in a few moves already being completed before actually cutting happens.