We investigate the optical and electrical characteristics of GaInNAs/GaAs long-wavelength photodiodes grown under varying conditions by molecular beam epitaxy and subjected to postgrowth rapid thermal annealing (RTA) at a series of temperatures. It is found that the device performance of the nonoptimally grown GaInNAs p + -i-n + structures, with nominal compositions of 10% In and 3.8% N, can be improved significantly by the RTA treatment to match that of optimally grown structures. The optimally annealed devices exhibit overall improvement in optical and electrical characteristics, including increased photoluminescence brightness, reduced density of deep-level traps, reduced series resistance resulting from the GaAs/GaInNAs heterointerface, lower dark current, and significantly lower background doping density, all of which can be attributed to the reduced structural disorder in the GaInNAs alloy.