Sunflower seeds. Something about the low-level but constant brain activity involved in cracking the shells in your mouth to get at the seeds works fantastically well for keeping me awake. Better than coffee.

It's also really hard to fill up on them, so I can just keep at em as long as I need to.

I always like fresh or dried fruit. They take a little longer to digest than refined sugar like those in candy, but you sufffer less of a come down from them. They also provide moisture in a more measured dose eliminated the annoying bathroom stops. I also find salty nuts especially sunflower seeds keep my emotionally and mentally aware....I've never nodded off with a mouth full of sunflower seeds!

As an over-the-road trucker for 15 years, I've had a lot of chances to experiment. I found that chocolate covered espresso beans work well. Just chomp 5-6 for a little boost and when they start to wear off, chomp a few more.