joomla/joomla-cms — pull request #3181 by rmcdaniel (2014-02-25 19:45:59+00:00)
Title: [#33342] JFormValidator JavaScript class does not scale well

http://joomlacode.org/gf/project/joomla/tracker/?action=TrackerItemEdit&tracker_id=8103&tracker_item_id=33342

This bug has been confirmed before but the fix was held up with the attempted purge of MooTools in favor of jQuery. I think it's time we visit this again since this is really an annoying bug for lots of people (See: http://forum.joomla.org/viewtopic.php?p=3002410).

Problem: The admin form validation Javascript has a time complexity of O(n^2) and therefore freezes the browser if you have lots of categories or menu items. For small sites with only 10 items, it isn't that noticeable because 10^2 is only 100 iterations but if you have 500 items, it's really bad since 500^2 is 250,000 iterations.

Solution: Precompute label-field associations once per validation attempt instead of per field. Please see forthcoming pull request.