I see two mistakes in your jsperf as noted in comments as well:
jQuery is heavily optimized.
.addClass
will only add it if it isn't already added.You don't check for it. You are just appending it using
+=
which creates numerous string instances as it runs for 10,00 times or so, which even crashed my browser;)
Dr.Molle's modified jsperf shows that by fixing the above things, it is the fastest.
Ah! Niet the Dark Absol has provided even a faster one here. It is fast because it uses native classList
and doesn't manually checks for availability of the class.