Strategy to stream large gcode file from serial port
Well, after some research I found something about Buffering on the RepRap documentation. I didn't see it before.

Works like this:


You send a command. An "ok" response it's received immediatly, that means that the command was successsfuly added to the buffer.
Then you can send another command. When the buffer is full, the "ok" response will be delayed until a new command it's received.


Some commands, for example M190: Wait for bed temperature to reach target temp will cause that the "ok" response will be delayed until the command finish his execution. That means that the printer won't accept more commands in the meantime.

I still have to check how many commands the buffer can save approximately, and if it's convenient to fill it entirely. I guess not, because let's say you want to pause the print. If you added a lot of commands to the buffer, you'll not able to pause it until all of them finished.

This thread on the RepRap forum was also useful.