Optimize ElemHide rules performance.