Welcome to the forum!
There is good thread about optimized start and end g-code for P series printers.