Description
The Problem appeared testing with myfaces-impl-2.0.7 and is still visible in the 2.1.6 Code.
HtmlRendererUtils.renderSelectOptions() loops over all SelectItems of a SelectBox to render them.
Rendering depends on the activation state of both the item to be rendered and the entire SelectBox. Therefore the method queries the "diasbled" property of the UI component to be rendered (SelectBox). This is performed in the SelectItem-Loop so it may happen very often (depending on the size of the Select-List).
It happens that queriing the "disabled" property implies calling the ViewBean to obtain the SelectItem-List (which the Method itself loops over!). This can be a perfromance issue if obtaining the SelectItem-List takes some time (in our example every single call took 10ms and the list consisted of 150 items so the call was performed 150 times which adds up to 1.5s). Anyway there is a lot of unnecessary Reflection and Method Calls to be avoided.
We solved the issue by simply moving the detection of the UI component's "disabled"-Property out of the loop.