I pay attention to complete, healthy nutrition, not just calories. As a long time endurance athlete, I had to study nutrition. So let me preface my answer this way, calories are important, but they aren't everything. It matters where you get your calories from. There are 3500 calories in a pound, but obviously ingesting 3500 calorie of processed white sugar is not as good for you, much less when your body is under stress, as 3500 calories taken from an array of fruits and vegetables. If the calories you consume are high quality and contribute to consuming all six basic nutrients (water, vitamins, minerals, carbs, protein, fats), you actually need less calories than if your calories come mainly from junk. If your body is properly fueled, it will work better and more efficiently, especially on a long thru-hike. That also means you don't have to carry as much stuff.
So for me, I always include a high-quality organic meal replacement powder. One of my favorites is Garden of Life's Raw Meal. It has about 100 calories per ounce, but better yet is that each 3 ounce scoop/serving (300 calories) contains 38 grams of carbs, 33 grams of protein and 4 grams of healthy fat. Plus a long, long list of vitamins, minerals, fruit and vegetable source superfoods, live probiotics and enzymes, etc. I usually mix a 20 ounce water bottle for breakfast and drink it throughout the morning.
I don't eat that for every meal - usually breakfast or also an after noon snack. But packing a ziploc with a pound or two of this type product is really compact in the medium flat rate box. I fit 1.5 lb bag of this and had plenty of room for a ton of extra stuff. Usually, rice noodle ramen, instant soups, humus mix, couscous, instant mashed potatoes, PB, dried fruits, GORP, Cliff bars, Emergency-C packs, etc. I also put in a 1 lb ziploc bag of powdered sports drink/recovery drink with protein and electrolytes to drink when I'm done hiking for the day.