I've got nothing for firefox, but the webkit inspector in Chrome has a profiler built in that is great for that kind of thing.
As an added bonus it also shows you all browser events such as repaints, so you can engineer your code to have the least impact on the browser.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…