You should be jumping when the teeth of your cart touch the start of a line. Keep in mind that it takes a few frames for your cart to jump after pressing B. The lines in these images are precise to the pixel.

Note that all consecutive jumps are buffered.

White = A small jump is more optimal, but you should probably do a slightly larger jump for safety.

Green = Smallest possible jump.

Orange = Medium jump. It's on the larger side of medium, though (hard to explain).

Red = Largest possible jump.

For the jump down the 1st large slope, prioritize doing the earliest possible jump rather than grabbing the 1st [+] barrel. Grabbing the 2nd [+] barrel only loses half a frame's worth of distance.

Minor Corrections: The 3rd and 4th gap jumps should be initiated as late as possible.