Hacker News new | ask | show | jobs
by onion2k 1665 days ago
You could avoid that quite easily by using IDs that don't need escaping though.

That said, the fact escaping is necessary could point to part of the reason why querySelector is slower. There's obviously some additional parsing necessary just to work out what the developer is requesting. If you don't need to spend that CPU time then it's certainly better not to.