Single-photon cooling at the limit of trap dynamics: Maxwell's demon near maximum efficiency