querySelector() and querySelectorAll() are slower than I expected. I have a couple of ideas for optimization. I'll upload patches, blocking this bug.