Variational optimization has been recently applied to nonlinear systems with many degrees of freedom such as shear flows undergoing transition to turbulence. This technique has unveiled powerful energy growth mechanisms able to produce typical coherent structures currently observed in transition and turbulence. However, it is still not clear the extent to which these nonlinear optimal energy growth mechanisms are robust with respect to external disturbances or wall imperfections. Within this framework, this work aims at investigating how nano-roughnesses such as those of superhydrophobic surfaces affect optimal energy growth mechanisms relying on nonlinearity. Nonlinear optimizations have been carried out in a channel flow with no-slip and slippery boundaries, mimicking the presence of superhydrophobic surfaces. For increasing slip length, the energy threshold for obtaining hairpin-like nonlinear optimal perturbations slightly rises, scaling approximately with Re−2.36 no matter the slip length. The corresponding energy gain increases with Re with a slope that reduces with the slip length, being almost halved for the largest slip and Reynolds number considered. This suggests a strong effect of boundary slip on the energy growth of these perturbations. While energy is considerably decreased, the shape of the optimal perturbation barely changes, indicating the robustness of optimal perturbations with respect to wall slip.