No alkaline cell is very efficient at high discharge currents, but for a given current D will be more efficient than AA.
As an example, a 0.7A flashlight bulb will only run for about an hour and a half on AA cells, but will run for 12 hours or more on D cells.
The length of time you can run a flashlight or other electronics on a given battery depends heavily on the load. For example, with flashlights, today's LED flashlights often have multiple levels and even the lower levels provide adequate ambient light when you don't need a lot of task lighting. My preference is always to use minimal lighting as much as possible, so using the lower levels on a flashlight is normal for me.
At a reasonable 250mA current draw, that single D cell will last 16 hours. But the AA will last 9 hours, so the D cell provides less than twice the runtime even though it contains 6 or 7 times the total energy as the AA cell. Now which one looks more efficient?