I was once taking an early morning flight out of D gate, the line was "S" shaped--but moved quickly. This occurs when a big convention ends.
The red-eyes have pretty short lines, the last time I went through security at 10:30 pm, there about 15 people on line.
Sometimes they will let D gate people use the C gate security lines--why don't they let them use A and B--once your have cleared security, you are no longer a "threat to safety" and since you can get from any gate to any other one (ie, you are connecting) this should be permitted.