I've been testing DOM selecting performance using jQuery.
I get some questions after comparing $("ul li:nth-child(999)") to $("ul li").eq(999)
$("ul li:nth-child(999)");
$("ul li").eq(999);
Please click on the following link to see my detailed test results :
Especially Chrome shows poor performance for operating nth-child pseudo classes.
I want to know why such a result is caused.
Can I get any algorithm, mechanism or references about that?
I would be very grateful if someone helps me.
Thanks.
I couldn't find any answer about this question anywhere, think that it can be an unknown bug. So I sent an email to Chromium Team, this issue has been ticketed on Chromium forum officially.
You can see the ticket for nth-child issue on the following link :
Thanks.