Counting thousands of selected checkboxes
I suspect you're going to struggle to optimise that, as DOM manipulation is always slow. See this guy's answer.

You could try do something like he suggests, keeping your data and the DOM separate from each other.


  Currently it loops through the entire form to count how many check boxes are selected, each time a checkbox is clicked


Why not increment or decrement a counter when a checkbox's state is changed? That'll be a lot quicker.