This ain't gonna work for 1,000,000 checkboxes. You could try using requestAnimationFrame or querying only non-checked checkboxes querySelectorAll('input[type="checkbox"]:not(:checked)') or not calling checkAllCheckboxes for all mutations.
Edit: or just call querySelector('input[type="checkbox"]:not(:checked)') and do them one by one in some kinda while(true) loop
(function() { 'use strict';
})();